#1   Report Post  
News Account
 
Posts: n/a
Default 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   Report Post  
Mayank Prakash Gupta
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Michael
 
Posts: n/a
Default

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   Report Post  
Michael
 
Posts: n/a
Default

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   Report Post  
malik641
 
Posts: n/a
Default


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   Report Post  
Michael
 
Posts: n/a
Default

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   Report Post  
malik641
 
Posts: n/a
Default


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   Report Post  
Michael
 
Posts: n/a
Default

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   Report Post  
malik641
 
Posts: n/a
Default


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I NEED HELP with the SPELLNUMBER Function vag Excel Worksheet Functions 0 June 21st 05 08:17 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"