ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   change background color of a cell with an "IF" command? (https://www.excelbanter.com/excel-worksheet-functions/148563-change-background-color-cell-if-command.html)

lee

change background color of a cell with an "IF" command?
 
I have a command using the IF function that is as follows:
=IF(M3=80,"YES","NO")

I would like to be able to add a green background if the YES condition is
met and a RED background if the NO condition is met. is there a line of code
that will do this.

Sandy Mann

change background color of a cell with an "IF" command?
 
Use Conditional Formatting with the the formulas:

=$M$3=80

and

=$M$3<80

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Lee" wrote in message
...
I have a command using the IF function that is as follows:
=IF(M3=80,"YES","NO")

I would like to be able to add a green background if the YES condition is
met and a RED background if the NO condition is met. is there a line of
code
that will do this.





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

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