Google Sheets – Flag Duplicate Rows in Two Columns

data validationdeduplicationformulasgoogle sheets

My question is similar to this one, but adds a little more complexity.

How can I flag duplicate entries in a Google Sheets column unless the duplicates have different values in another column? For instance, consider the table

col A    col B
--------------
abc      123
def      123
ghi      456
ghi      456

How can I flag the last two rows which are the same in both col A and col B but not the first two which differ in col A?

Best Answer

  • this custom formula is able to flag 1st (cell) occurrence of a duplicate pair:

=COUNTIFS($A1:$A, "="&A1, 
          $B1:$B, "="&B1)<2

1