Conditional Formatting - more than 2 merged rows

blandest

New Member
Joined
Apr 17, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi,
I found partial solution for my problem in an older thread. I need to apply conditional formatting from merged cell to unmerged cells.
It works for 2 merged rows, but I would need to apply formatting to 4 rows. For 4 merged rows it's applied only to the first 2 rows.
If there is a text (x) in a B column, then formatting is applied to the rest of the row in the table.
Check the xl2bb.

Test plan HZB_EN_DE_test.xlsx
BCDEFGHIJKLMNOPQRS
2xtext
3
4xtext
5
6xtext
7
8xtext
9
10
11xtext
12
13
14
15xtext
16
17
18
19xtext
20
21
22
23xtext
24
25
26
Tests
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:S9,B11:S26Expression=OR(ISTEXT($B1),ISTEXT($B2))textNO
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to the problem with Merging cells. Just don't do it! Use "Center Across Selection" under Horizontal Alignment.
1681814826837.png

That way your columns don't get all screwed up!
 
Upvote 0
Welcome...

Thanks for the hint! I already noticed, that there is a lot of fun with merged cells :)
Unfortunately, this doesn't solve my problem.
There is no such option under Vertical alignment, which I would need. And even if this option would be there I'm not sure if it would format all the rows behind it.
My goal is to apply formatting to columns after column B if there is a text in column B.
 
Upvote 0
To apply conditional formatting to a merged cell and the cells below it, you can modify the formula in the conditional formatting rule to check if either the merged cell or the cell directly below it contains the specified text.

For example, to apply conditional formatting to a merged cell spanning four rows, you can use the following formula:

=OR(ISTEXT($B1),ISTEXT($B2),ISTEXT($B3),ISTEXT($B4))

This formula checks if any of the four cells in column B (B1, B2, B3, or B4) contains text. If any of these cells contain text, the conditional formatting will be applied to the entire row.

To apply this formula to the merged cells B2:S9 and B11:S26, you can select these cells, open the conditional formatting dialog, and create a new rule with the "Use a formula to determine which cells to format" option. Then, enter the above formula in the formula field, choose the desired format, and click OK to apply the rule.

Note that you should uncheck the "Stop If True" option, as this will prevent the formatting from being applied to subsequent rows if the formula evaluates to TRUE in the first row.
 
Upvote 0
To apply...

I got it!
I already tried adding other cells to the formula (B3, B4), but it was not working.
The catch is that you have to add previous cells there. But sice you cannot add B0, B-1 you have to move the table down so the table begins on B6 (or whatever) and then the formula looks like this =OR(ISTEXT($B3),ISTEXT($B4),ISTEXT($B5),ISTEXT($B6)) with the table beginning on B6. It makes no sense, but it works :) Check the xl2bb

Test plan HZB_EN_DE_test.xlsx
BCDEFGHIJKLMNOPQRS
6xtext
7
8
9
10xtext
11
12
13
14text
15
16
17
18xtext
19
20
21
Tests
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B6:S21Expression=OR(ISTEXT($B3),ISTEXT($B4),ISTEXT($B5),ISTEXT($B6))textNO
 
Upvote 0

Forum statistics

Threads
1,215,544
Messages
6,125,444
Members
449,226
Latest member
Zimcho

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