Conditional formatting to match other cells depending on "text"

Lmaonade

Board Regular
Joined
Jan 5, 2018
Messages
52
Hi,

I have a sheet I'm having trouble trying to make work without macros. I've pasted below an example of part of my sheet.

I already have conditional formatting set up a cell to change colour if it has the letter in cells A,C,E,G, etc. How do I set up a rule for the cell directly to the right to match those cell and the cell directly underneath to also match the cell.

So basically, if cell A3 = "C" I want cell B3 and A4 to be formatted to change to a specific colour. I want these rules across my entire sheet, without having to create a lot of different rules. I'd appreciate any help you can give me.

Kind regards,
Andy

Rota New (2022).xlsx
ABCDEFGHIJKLMN
1CLong DayCLong DayCLong DayCEarly Day
2OldhamMeadowsOldhamOldham
3CNightCNightCNightCNightCNightCNight
4RochdaleRochdaleBuryRochdaleRochdaleBury
5CNightCNightCNight
6BuryBuryBury
7CNightCNightCNight
8StockportTamesideTameside
9CNightCNightCNight
10LiverpoolLiverpoolStockport
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:N10Cell Value="A"textNO
A1:N10Cell Value="B"textNO
A1:N10Cell Value="W"textNO
A1:N10Cell Value="C"textNO
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
It is possible to do this with a single rule for each color, assuming your format is exactly like what you are showing in your example. Use this rule to replace the one you have.

For blue:
Applies To: A1:N10
New rule > Use a formula to determine which cells to format:
Excel Formula:
=OR(A1="A",IF(ROW(A1)>1,OFFSET(A1,-1,0)="A"),IF(COLUMN(A1)>1,OFFSET(A1,0,-1)="A"))

Duplicate for other colors, updating "A" to "B", "W", etc.

I don't think the merged cells are going to be a problem in this particular case but Excel experts generally discourage the use of merged cells.
 
Upvote 0
It is possible to do this with a single rule for each color, assuming your format is exactly like what you are showing in your example. Use this rule to replace the one you have.

For blue:
Applies To: A1:N10
New rule > Use a formula to determine which cells to format:
Excel Formula:
=OR(A1="A",IF(ROW(A1)>1,OFFSET(A1,-1,0)="A"),IF(COLUMN(A1)>1,OFFSET(A1,0,-1)="A"))

Duplicate for other colors, updating "A" to "B", "W", etc.

I don't think the merged cells are going to be a problem in this particular case but Excel experts generally discourage the use of merged cells.
Hi 6StringJazzer.

This works perfectly. :) I really appreciate your help. Thank you so much.

Kind regards,
Andy
 
Upvote 0

Forum statistics

Threads
1,223,749
Messages
6,174,275
Members
452,553
Latest member
red83

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