Conditional Formatting: what do I do wrong?

Hans Troost

New Member
Joined
Jan 6, 2015
Messages
30
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Dear reader,

I made a spreadsheet with some measurement results. All measurements have an maximum acceptable value or a minimum acceptable value, some have both (so a range).
I added conditional formatting to get red coloured values of they are outside this range. The problem arises for those cases where the min. valu or the max. value is missing (and doesn't exist in reality).

I tried to capture that in the formula for the conditional formatting:

This is an image of the sheet (dates in Dutch, since I'm living in The Netherlands)
4MrExcel-Sheet.png

The conditional formatting is for an extended range of cells (for the future, possibly more measurements and for sure more dates:
4MrExcel-CondFormat.png

and - the formula I used is this one:
4MrExcel-TheFormula.png
intending that: if the value is higher then Max and the Max is given (not empty) then format red, OR the value is lower then Min. and Min. is not empty.
In text the fomula is:
=OR(AND(D2>C2;C2<>"");(AND(D2<b2;b2<>""))), where Column B possibly contains the Min value and Colum C the Max value.
</b2;b2<>​

It seems to work well in the first rows, but fails in some cases, highlighted in the red rectangle in the sheet. Rows for M-10 and M11

So... I did do something wrong. Can anybody help me out?

To enable you to check it yourself and play with it, please download the DropBox-copy: https://www.dropbox.com/s/wf2d20tjkzs4tq7/4MrExcel.xlsx?dl=0

Thanks in advance for any help,

Hans Troost
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
try this

=OR(AND(D2>$C2,$C2<>0),(AND(D2<$B2,$B2<>0)))
 
Upvote 0
Solved: Conditional Formatting: what do I do wrong?

Thanks, that solves the problem!
 
Upvote 0
I just used this formula as a test where B36 is the value being tested. C is the minimum and D is the Maximum.

=AND(ISBLANK($C$36),$B$36<$D$36)
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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