Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Highlight Duplicates in Google Sheets

Use conditional formatting and COUNTIF to highlight repeated values, ignore blank cells, or flag only the second and later copies.

Table of Contents

Highlight duplicates with a conditional formatting rule that counts how often a value appears. For a list in column A with a header in row 1, apply the rule to A2:A and use =AND(A2<>"",COUNTIF($A$2:$A,A2)>1). This colors every occurrence of a repeated value and ignores blanks.

Set up the duplicate rule

  1. Select A2:A, leaving the header outside the range.
    How to Highlight Duplicate Data in Google Sheets Picture 1
  2. Choose Format > Conditional formatting and verify Apply to range.
    How to Highlight Duplicate Data in Google Sheets Picture 2
    How to Highlight Duplicate Data in Google Sheets Picture 3
  3. Under Format cells if, choose Custom formula is and paste the formula above. The older screenshot uses a formula that includes the header and does not exclude blanks.
    How to Highlight Duplicate Data in Google Sheets Picture 4
    How to Highlight Duplicate Data in Google Sheets Picture 5
  4. Choose a fill color and click Done. Two cells containing the same entry should both change color.
    How to Highlight Duplicate Data in Google Sheets Picture 6
    How to Highlight Duplicate Data in Google Sheets Picture 7

Highlight only the extra copies

To leave the first occurrence uncolored, use =AND(A2<>"",COUNTIF($A$2:A2,A2)>1). The count starts at row 2 and ends at the current row, so the second and later occurrences are highlighted.

Fix a rule that highlights the wrong rows

Make the formula’s relative row match the first row of your selected range. For example, if the range starts at B3, adjust both the starting row and the column in the formula. For a large sheet, use a bounded range such as A2:A1000 if the whole-column rule slows it down. If your locale uses semicolons in formulas, replace the argument commas accordingly.

COUNTIF treats uppercase and lowercase letters as the same. Review the highlighted rows before deleting anything. See Google’s conditional formatting guide for more examples.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.