Conditional Formatting

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,516
Office Version
  1. 2016
Platform
  1. Windows
Hello Friends,

I need help with conditional formatting. I set two conditions on a cell that

if a cell value is lower then 0 then red
if a cell value is greater then 0 then green

conditional formatting is turning the cell green even if it returns text "OK" as an answer


I am using this formula
=IF(OR(ISBLANK($F68),ISBLANK(N68)),"",IF($F68=N68,"OK",N68-$F68))

There are 4 possible answers to that cell...
1) a value greater then 0
2) a value less then 0
3) a text "OK"
4) a blank cell ""


I would want the conditional formatting to only turn if red or green if the value is lower or greater then zero. Dont do anything if the cell returns a blank or a text "OK".

Any help would be appreciated,

Regards,

Humayun
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Clear your current conditional formatting and use

Change F3 to your cell

for green
Code:
=AND(ISNUMBER(F3),F3>0)

for red
Code:
=AND(ISNUMBER(F3),F3<0)

This will leave the cell unformatted for 0 if you want it to change you can modify the formula or add a different one if you want it to be a different color.
 
Last edited:
Upvote 0
I might be missing something here but I do not see why you are using a formula for what can be achieved using set rules:

In conditional formatting choose the option Format only cells that contain, then choose the greater than and less than options.
 
Upvote 0
I might be missing something here but I do not see why you are using a formula for what can be achieved using set rules:

In conditional formatting choose the option Format only cells that contain, then choose the greater than and less than options.

When you do that OK will trigger the conditional formatting. By using formulas the value can be tested to make sure it is a number since "Dont do anything if the cell returns a blank or a text "OK""
 
Last edited:
Upvote 0
When you do that OK will trigger the conditional formatting. By using formulas the value can be tested to make sure it is a number since "Dont do anything if the cell returns a blank or a text "OK""

Told you I may be missing something! Thanks Scott.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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