Conditional Formatting Won't Work If Cell Have Formula

miffy45

New Member
Joined
Dec 18, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,
I'm facing a weird case while doing some conditional formatting on my report.

The condition is:
Cell turn Red if value lower equal to -0.1 and higher equal to 0.1
Cell turn
Yellow if value between -0.1 and -0.05; 0.1 and 0.05
1673327444737.png

Above condition applies to Cell D4 & E4, please see my formatting below:
1673327829953.png
1673327856071.png

Red:
Excel Formula:
=(OR($D$4<=-0.1,$D$4>=0.1))
Yellow:
Excel Formula:
=(OR(AND($D$4>-0.1,$D$4<=-0.05),(AND($D$4>=0.05,$D$4<0.1))))

It works well when cell D4 with value 0.1 and cell E4 with value -0.1, both turn red.
1673328399673.png


But, when i try cell D4 with value -0.1 and cell E4 with value 0.1 turn yellow, where they should be red.
1673328058060.png


At first i tought that my formula have an issue, so i tried input the value in cell D4 and E4 manually (without the substract formula), it works perfectly.
1673328613471.png
1673328664771.png


Kindly help me point out what's wrong with my formula or format or else.
Thank you.
 

Attachments

  • 1673328640896.png
    1673328640896.png
    9.1 KB · Views: 5

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
As you are dealing with small numbers you are the " victim" of floating point arithmetic
You'll have to wrap your values with the ROUND function to be on the safe side ( see the end of the article)
 
Upvote 0
Solution
ah thank you, perfect information 😆
Hope you have a great day!
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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