Search code examples
google-sheetsgoogle-sheets-formulaconditional-formattinggs-conditional-formatting

Highlight duplicated values in many cells in Google Sheets


I have dozens of columns where I want to highlight duplicates. I have an issue with the formula. Here is what I have:

=COUNTIFS($B$3:$B,$C$3:$C,$D$3:$D,$E3:$E,$F3:$F,$G$3:$G,$H$3:$H,$I$3:$I,$J$3:$J,$K$3:$K,$L$3:$L,$M$3:$M,$N$3:$N,$O$3:$O,$P$3:$P,$Q$3:$Q)>1

I have also tried this:

=COUNTIFS($B$3:$B,$B3:$B,$C$3:$C,$C3:$C,$D$3:$D,$D3:$D,$E$3:$E,$E3:$E,$F$3:$F,$F3:$F,$G$3:$G,$G3:$G,$H$3:$H,$H3:$H,$I$3:$I,$I:$I,$J$3:$J,$J3:$J,$K$3:$K,$K3:$K,$L$3:$L,$L3:$L,$M$3:$M,$M3:$M,$N$3:$N,$N3:$N,$O$3:$O,$O3:$O,$P$3:$P,$P3:$P,$Q$3:$Q,$Q3:$Q)>1

Google sheets says: Invalid formula. What is wrong with it? Is there an easy way of doing it instead of typing all the columns one by one?


Solution

  • Apply a custom formula for conditional formatting.

    If you want to check everything from row 3 to the very bottom then use

    =COUNTIF($B$3:$S, B3) > 1
    

    applied to B3:S.

    If you want to handle only the range B3:S22 then apply to it:

    =COUNTIF($B$3:$S$22, B3) > 1
    

    Do not forget those $s.