IF statement to color code a cell

Copper Contributor

I need a formula to Color Code a cell in an excel sheet.  I want the formula to color code to Orange if the wording of the cell is OPEN.

5 Replies

@EMonroe1963 

You can do that using conditional formatting, not a formula.

Select the relevant range.
On the home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'equal to' from the second drop down.
In the box next to it, enter the formula

="OPEN"

Click Format...
Activate the Fill tab.
Select orange as highlight color.
Click OK, then click OK again.

That worked perfectly for that column. I have another column that I would like to do the same thing for (different color but there is already a formula there: =IF(LEN(E2)>1, IF(LEN(F2)>1, EXACT(PROPER(E2&" "&F2),E2&" "&F2),"FALSE"),"FALSE") so that when I try to do the Conditional Formatting it does not change the color. Do I have to add something to the above formula for it to automatically fill the color when the statement in the cell is "FALSE"?

@EMonroe1963 

Replace "FALSE" with FALSE

@Hans Vogelaar 

That worked as well. Thank you!  Here is the toughest portion I face. I've tried to send this to you earlier and hoping it works now.  I need a formula to help determine correct capitalization for these fields: E, F, G, and H (Canadian Postal Codes) that will read out TRUE or FALSE in Field J. I have a formula that works for fields E and F but I am unable to develop one that will cover all four fields. I'm attaching this small excel sheet. Hopefully you will be able to see it this time. 

@EMonroe1963 

A full solution would be complicated, since you'd have to handle names such as McCartney and DeLorean.

A partial solution:

=AND(EXACT(PROPER(E2:H2), E2:H2))

If you do not have Microsoft 365 or Office 2021, confirm the formula by pressing Ctrl+Shift+Enter.