ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   adding color to the results of IF statements (https://www.excelbanter.com/excel-worksheet-functions/24050-adding-color-results-if-statements.html)

Mark

adding color to the results of IF statements
 
I am trying to make an IF statement results have different colored cells
depending on their outcome. For instance, if A=B, I want the cell to say "GO"
with green fill around it. If A does not =B, I want the cell to say "STOP"
with red fill aound it. How can I do this?

zackb

In a seperate cell, enter your formulas ...

=IF(A1="B","GO","STOP")

Then select this cell, goto Format (menu) | Conditional Formatting | Formula
Is ...

=B1="GO"

Format condition to Green, confirm with the Ok button. Now set the regular
format of the cell to a background color of Red. Btw, this also assumes
that you entered this in cell B1; if not, change the B1 in the Conditional
Format formula to match that of the cell address you are inputing it on.

--
Regards,
Zack Barresse, aka firefytr


"Mark" wrote in message
...
I am trying to make an IF statement results have different colored cells
depending on their outcome. For instance, if A=B, I want the cell to say
"GO"
with green fill around it. If A does not =B, I want the cell to say "STOP"
with red fill aound it. How can I do this?




Bob Phillips

You need conditional formatting.

Look up 'Highlight cells that meet specific conditions' in the Answer
wizard in help


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mark" wrote in message
...
I am trying to make an IF statement results have different colored cells
depending on their outcome. For instance, if A=B, I want the cell to say

"GO"
with green fill around it. If A does not =B, I want the cell to say "STOP"
with red fill aound it. How can I do this?





All times are GMT +1. The time now is 04:38 PM.

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