Conditional format with formula?

jackdiamond

Board Regular
Joined
Oct 10, 2007
Messages
220
Afternoon,

I have the formula =IF(F4>=K4,"YES","").

However, when the result is yes, I want the cell to turn green and if no, turn red.

Does anyone know how I can do this please?

I had conditional formatting set up for the colour change but when I added a formula, it all went pear shaped!

Any help appreciated
Thanks
Stu
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Select the range you want the conditional formatting on, go to conditional formats, and make it:

  1. Cell Value -- Is Equal to -- ="Yes" -- Green format
  2. Cell Value -- Is Equal to -- ="No" -- Red Format
 
Last edited:
Upvote 0
I already had that set up in conditional formatting and it worked fine.

then I decided that I wanted the cell to populate "Yes or No" itself by using the formula =IF(F4>=K4,"YES","").

This then stopped my conditional formatting from working.

Any idea why?
 
Upvote 0
No.

The formula works fine displaying the yes or no but it seems to have over ridden the conditional formatting?
 
Upvote 0
Go into conditional formatting and make sure it doesn't show something like =""Yes"" (note the double quotes). If it does, retype in there:

Code:
="Yes"
 
Upvote 0
Yea sorry I was unclear I meant does the conditional formatting not work regardless of what the cell displays
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top