ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   IF Function (https://www.excelbanter.com/new-users-excel/37040-if-function.html)

News Account

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



Mayank Prakash Gupta

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





Bob Phillips

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





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


"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




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


"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




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 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


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


"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



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

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


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.
--
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



malik641


I agree. And I'm glad to see I didn't miss anything :cool:
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



All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com