Cell formatting based on value in cell below

matt9031

New Member
Joined
Sep 24, 2021
Messages
2
Hi, I have a large dataset and am trying to find a quick way to format certain cells without setting up hundreds of conditional formatting rules.

Where a cell = "A", I would like the cell above to highlight in Yellow. Where a cell = "C", I would like the cell above to highlight in Green.

Please can someone advise the best way to accomplish this, a macro or conditional formatting. Not had much luck so far.

Appreciate your guidance. Thanks.

1632495154375.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi & welcome to MrExcel.
Select the range you want this to work on & use
Excel Formula:
=A2="A"
change the A2 to reflect the 1st column & 2nd row of the selected range
 
Upvote 0
Solution
Hi Matt9031,

Like this?

Matt9031.xlsx
ABCDEFG
1Item 11500100330220
2AACC
3Item 22244
4AA
5Item 340445045055
6ACCA
7Item 440422155
8AAC
9Item 5323450455
10CCC
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B1:G10Expression=B2="C"textNO
B1:G10Expression=B2="a"textNO
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,566
Messages
6,125,597
Members
449,238
Latest member
wcbyers

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