Color formatting based on cell value difference

MarioCald

New Member
Joined
Apr 6, 2021
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
I would like to enter a number (InputNumber) and then if the value (Value) is within -/+ 1 (0.0 to 1.0), color the value row green. If the value (Value) is within -/+ 1 to -/+ 1.5 (1.01 to 1.50), color the value row yellow. If the difference is greater then 1.5, don't do anything.

I tried playing with IF/OR statements and conditional formatting but couldn't figure out a suitable command.

Thank you.

Capture.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Select the entire range to be formatted (i.e., A3:B7 in your picture). You will need two conditional formats.

For the first, select Use a formula to determine which cells to format. Enter the formula =ABS($B$1-$B3)<=1 and select the green fill color.
For the second, select same conditional format choice, and enter formula =AND(ABS($B$1-$B3)>1,ABS($B$1-$B3)<=1.5)+

Hope this helps.

Bill B.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,996
Messages
6,122,636
Members
449,092
Latest member
bsb1122

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