Home |
Search |
Today's Posts |
#1
|
|||
|
|||
IF Function
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 |
#2
|
|||
|
|||
do conditional formatting on the cell (or column) and say that if the cell
value is "loss" paint it red.... goto Formatconditional formattting hope it helps. MPG "News Account" wrote in message ... 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 |
#3
|
|||
|
|||
I don't think it can be done, you would need VBA to be acting on the cell.
-- HTH Bob Phillips "News Account" wrote in message ... 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 |
#4
|
|||
|
|||
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 "News Account" wrote: 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 |
#5
|
|||
|
|||
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 "Michael" wrote: 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 "News Account" wrote: 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 |
#6
|
|||
|
|||
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 Account Wrote: 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 -- malik641 ------------------------------------------------------------------------ malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190 View this thread: http://www.excelforum.com/showthread...hreadid=390126 |
#7
|
|||
|
|||
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 "malik641" wrote: 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 Account Wrote: 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 -- malik641 ------------------------------------------------------------------------ malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190 View this thread: http://www.excelforum.com/showthread...hreadid=390126 |
#8
|
|||
|
|||
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 Michael Wrote: 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 | +-------------------------------------------------------------------+ -- malik641 ------------------------------------------------------------------------ malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190 View this thread: http://www.excelforum.com/showthread...hreadid=390126 |
#9
|
|||
|
|||
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. -- Michael Mitchelson "malik641" wrote: 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 Michael Wrote: 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 | +-------------------------------------------------------------------+ -- malik641 ------------------------------------------------------------------------ malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190 View this thread: http://www.excelforum.com/showthread...hreadid=390126 |
#10
|
|||
|
|||
I agree. And I'm glad to see I didn't miss anything Michael Wrote: If we don't provide alternatives, were wrong.......if we do, were still wrong. -- malik641 ------------------------------------------------------------------------ malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190 View this thread: http://www.excelforum.com/showthread...hreadid=390126 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I NEED HELP with the SPELLNUMBER Function | Excel Worksheet Functions | |||
Excel option to store trendline's coefficients in cells for use | Charts and Charting in Excel | |||
Date & Time | New Users to Excel | |||
Automatically up date time in a cell | Excel Discussion (Misc queries) | |||
clock | Excel Worksheet Functions |