Conditional Formatting based on adjacent cell value

MichaelWayne_71

Board Regular
Joined
Nov 9, 2005
Messages
60
I have two columns (A and B) and I want B1 to be formatted RED if greater than A1 and GREEN is less than A1. The same should be true for all other rows. (i.e.-B2396 should be compared to A2396...not A1)
...possible?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,144
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I have two columns (A and B) and I want B1 to be formatted RED if greater than A1 and GREEN is less than A1. The same should be true for all other rows. (i.e.-B2396 should be compared to A2396...not A1)
...possible?
1. Select all the cells in column B you want the CF to apply to
2. Use the following formulas (one at a time) to set the CF

=$B1>$A1 (format as red)
=$B1<$A1 (format as green)
 
Upvote 0

ArthriticPanda

Active Member
Joined
Feb 24, 2013
Messages
292
Excel Workbook
AB
11012
2115
3126
41322
51412
61515
7162
81719
9186
10197
112021
122134
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B11. / Cell Value less than =$A$1Abc
B12. / Cell Value greater than =$A$1Abc
B21. / Cell Value less than =$A$1Abc
B22. / Cell Value greater than =$A$1Abc
B31. / Cell Value less than =$A$1Abc
B32. / Cell Value greater than =$A$1Abc
B41. / Cell Value less than =$A$1Abc
B42. / Cell Value greater than =$A$1Abc
B51. / Cell Value less than =$A$1Abc
B52. / Cell Value greater than =$A$1Abc
B61. / Cell Value less than =$A$1Abc
B62. / Cell Value greater than =$A$1Abc
B71. / Cell Value less than =$A$1Abc
B72. / Cell Value greater than =$A$1Abc
B81. / Cell Value less than =$A$1Abc
B82. / Cell Value greater than =$A$1Abc
B91. / Cell Value less than =$A$1Abc
B92. / Cell Value greater than =$A$1Abc
B101. / Cell Value less than =$A$1Abc
B102. / Cell Value greater than =$A$1Abc
B111. / Cell Value less than =$A$1Abc
B112. / Cell Value greater than =$A$1Abc
B121. / Cell Value less than =$A$1Abc
B122. / Cell Value greater than =$A$1Abc




AP
 
Upvote 0

Akashwani

Well-known Member
Joined
Mar 14, 2009
Messages
2,911
Hi,

Highlight B1 down to your last cell.
For Greater than...
Press, alt H L H G
Type =$A1 into the white box and set your format.

For Less than...
Press, alt H L H L
Type =$A1 into the white box and set your format.

I hope that helps.

Ak
 
Upvote 0

MichaelWayne_71

Board Regular
Joined
Nov 9, 2005
Messages
60
ADVERTISEMENT
1. Select all the cells in column B you want the CF to apply to
2. Use the following formulas (one at a time) to set the CF

=$B1>$A1 (format as red)
=$B1<$A1 (format as green)

Does not work for some reason.
is it because there are other formulas in the cell?
 
Upvote 0

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,144
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Does not work for some reason.
is it because there are other formulas in the cell?
The formulas do not go in the cells, they are used to specify the conditions. Conditional Formatting/New formatting rule/ use a formula ...
 
Upvote 0

MichaelWayne_71

Board Regular
Joined
Nov 9, 2005
Messages
60
Got it...thanks! I used A & B as examples and forgot to change it in my spreadsheet. Actually J & F:confused:
Thanks again All!! You all are always a great help
 
Upvote 0

Forum statistics

Threads
1,195,849
Messages
6,011,957
Members
441,657
Latest member
Diupsy

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