IF Function

N

News Account

Is it possible to define a text value in an IF function to a particular
colour, the function is

=IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
))))

I would prefer the "Loss" to entered automatically in red.

Many thanks
 
M

Mayank Prakash Gupta

do conditional formatting on the cell (or column) and say that if the cell
value is "loss" paint it red....

goto Format>conditional formattting

hope it helps.
MPG
 
M

Michael

Hi
As you only have 3 conditions, try using Conditional Formatting.
Use cell value is equal to WIN, Cell value is equal to LOSS and cell value
is equal to 0
You could also consider changing your formula to:
=IF(OR(C38=1,C38=2),"WIN",IF(OR(C38=-1,C38=-2),"LOSS",0))


HTH
Michael Mitchelson
 
M

Michael

Just a little more thinking outside the box.
If it wasn't vital that you used -2,-1,0,1,2 and changed to all positive
numbers, ie, 1,2,3,4,5.
You could use this formula instead.

=CHOOSE(C38,"loss","loss",0,"win","win")

I obviously need to get a real life !!
Regards
Michael Mitchelson
 
M

malik641

Is it just me, or can News Account just simply go to Format->Conditional
Formatting and choose "Formula Is" and Just write:

=C1="Loss"
(Given C1 is to be evaluated)

Then format the text to be red?
It would read the cell and if it says "Loss" it would format red, if
not...then nothing.

I didn't miss anything did I?
If not, I think this should work just fine.

News said:
Is it possible to define a text value in an IF function to a particular
colour, the function is

=IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
))))

I would prefer the "Loss" to entered automatically in red.

Many thanks
 
M

Michael

Hi Malik
Nothing wrong with your thinking.
The OP would still need to use the formula 3 times in Conditional Formatting
though.
One for win, one for loss, and one for draw
But, that's why we are all here helping each other.......'cause we think
differently.
Regards
Michael Mitchelson
 
M

malik641

Well if he wants a color ONLY for loss...then what I said should be all
he needs.

Here's an attachment to show you what I mean.
Play with C38 (i.e. put "1" or "-1" or "0") and watch cell A1
Then select A1 and select Format->Conditional Formatting, and you'll
see what I mean.

If there's anything that I'm missing, let me know....otherwise I'm
pretty sure this is what News Account originally asked for.

Let me know
Hi Malik
Nothing wrong with your thinking.
The OP would still need to use the formula 3 times in Conditional
Formatting
though.
One for win, one for loss, and one for draw
But, that's why we are all here helping each other.......'cause we
think
differently.
Regards
Michael Mitchelson


+-------------------------------------------------------------------+
|Filename: Conditional Format Test.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3649 |
+-------------------------------------------------------------------+
 
M

Michael

Malik
You are correct !!
I think we just extended his thinking a little bit to include other options.
If we don't provide alternatives, were wrong.......if we do, were still
wrong.
Sorry, that wasn't directed at you....just an observation in general.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Adding numbers and text 4
Function 6
Hide columns code 0
Function not completely volatile help 13
Difficulties with date in conditional calculations 2
Using Styles In An Outline 0
Vlookup Problem 3
Problem 23

Top