Search code examples
google-sheetsmatchgoogle-sheets-formulaarray-formulasgs-conditional-formatting

How would I alternate row colors whenever a value changes in any column?


I'm trying to get Google Sheets to alternate row colors whenever any cell in the row is different from the cell above it (within a specified range).
For instance:

example image

I found a few related solutions (this one for example), but they all base the alternation on only one column's changes; the MATCH function only applies to a one-dimensional range.

Is there any way to accomplish this with multiple columns?


Solution

  • =ARRAYFORMULA(ISODD(MATCH($A2&$B2&$C2&$D2,UNIQUE($A$2:$A&$B$2:$B&$C$2:$C&$D$2:$D),0)))
    

    0