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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

bbotzong

Board Regular
Joined
Dec 17, 2003
Messages
56
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
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.
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,130,042
Messages
5,639,717
Members
417,107
Latest member
derekMG

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
Top