A quick look around the Internet and you can easily notice a common problem: Conditional Formatting in Excel (2010) are often split when inserting rows that intersect the area they're formatting.
However, this "splitting" isn't consistent: What requirement does a Conditional Formatting rule need to following in order to avoid being split?
Steps to Reproduce
- New Excel document
In "Sheet1":
- Write "1" in
A1
; "2" inA2
; and so on up toA20
. (I used a formula to simplify this)
- Write "1" in
In "Sheet2":
- Write "2" in all the cells in the range
A3:A15
- Write "foobar" in all the cells in the range
B3:B15
(exceptB5
andB12
which should be empty) - Write "1" in
D1
; "2" inE1
; "3" inF1
; and so on up toM1
. (I used a formula to simply this)
- Write "2" in all the cells in the range
In "Sheet3":
- Write "3" in
A1
; "5" inA2
- Write "3" in
In "Sheet2" select
D3:M15
, "New Rule..." "using a formula to determine which cells to format":formula:
=AND($B3<>"",MATCH(D$1,Sheet3!$A$1:$A$10,0))
format: Set background FILL to bright orange.In "Sheet2" select
A3:M15
, "New Rule..." "using a formula to determine which cells to format":formula:
=AND(MOD(Sheet1!$A1,2)=0,$A3=2)
format: Set a solid black line to the bottom borderYou should see a line every two rows.
Select Row 8; Insert a row; Enter "2" and "foobar" in the newly inserted row. Notice how you nolonger have a line every two rows! This is due to the conditional formatting being split in two.
Open the "Manage Rules" (under Conditioanl Formatting). Only one of the two rules has been split. Why?!
Observations
The two Conditional Formatting rules above are similar (i.e. both refer to cells in other sheets) and yet Excel treats them differently. Why?!
Side note: The above example is used to explain the problem in a simplified context. Offering alternatives to "formatting every other row" does not solve the problem of understand why Excel treats some rules differently than others.