Search code examples
google-sheetsconditional-formatting

Google Spreadsheets: Group rows by equal cell and set background color for these rows


Using Google Spreadsheets: I need to Group rows by equal cell value and set background color for these rows.

I need to alternate two color, one for each match.

Here an editable spreadsheet with the real example. The key value is the cell on column B:title (KEY)

Editable file: https://docs.google.com/spreadsheets/d/1klXxhhdgaazGc-secQPZfwdNijLUK6OVOQUxdU-scQU/edit?usp=sharing

Capture:enter image description here


Solution

  • Added solution to your sheet here:

    Helper Column formula:

    =scan(;B2:index(B:B;match(2;1/(A:A<>"")));lambda(a;c;if(c<>offset(c;-1;);a+1;a)))
    

    Conditional formatting custom_formula:

    Apply to range: A2:C

    =isodd($D2)
    =iseven($D2)*len($D2)
    

    enter image description here