How to highlight duplicates in Google Sheets

Quick answer

Select the column, for example A2:A, then open Format > Conditional formatting. Under Format cells if, choose Custom formula is, enter =COUNTIF($A$2:$A,A2)>1 and pick a color. Every value that appears more than once lights up, and nothing gets deleted.

The example data

Every rule below runs on this class sign-up sheet. Maya Chen and Leo Park each signed up twice. Sam Reyes did too, but the second time the name was typed in lower case. Google Sheets has no ready-made “duplicates” option in conditional formatting, so each rule is one short custom formula.

ABC
1NameEmailClass
2Maya Chenmaya@mail.comYoga
3Leo Parkleo@web.comSpin
4Maya Chenmaya@mail.comPilates
5Sam Reyessam@shop.comYoga
6Leo Parkleo@web.comSpin
7Nia Brooksnia@mail.comSpin
8sam reyessam@shop.comYoga
9Omar Aliomar@web.comYoga
Class sign-ups, with a few people listed more than once.

Highlight duplicates in one column

  1. Select the cells to check, for example A2:A9. Use A2:A to cover rows you add later.
  2. Open Format > Conditional formatting. The rules panel opens on the right.
  3. Under Format cells if, choose Custom formula is.
  4. Enter =COUNTIF($A$2:$A,A2)>1.
  5. Pick a fill color under Formatting style and click Done.
ABC
1NameEmailClass
2Maya Chenmaya@mail.comYoga
3Leo Parkleo@web.comSpin
4Maya Chenmaya@mail.comPilates
5Sam Reyessam@shop.comYoga
6Leo Parkleo@web.comSpin
7Nia Brooksnia@mail.comSpin
8sam reyessam@shop.comYoga
9Omar Aliomar@web.comYoga
Every name that appears more than once is colored. Only Nia Brooks and Omar Ali stay plain.

For each cell, COUNTIF counts how often its value appears in the column. A count above 1 means the value is repeated, so the cell gets the color.

The dollar signs in $A$2:$A lock the range, so every cell is compared against the same column. A2 has no dollar signs, so it moves down with the rule: Sheets checks A3 for row 3, A4 for row 4, and so on.

The cell in the formula has to be the first cell of the range you selected. If you selected A1:A but wrote A2, the colors land one row off. Change the formula to =COUNTIF($A$1:$A,A1)>1, or change the range under Apply to range.

Highlight only the second and later copies

Coloring every copy shows you which names repeat. To see only the extra entries, and leave the first one plain, count from the top of the list down to the current row:

=COUNTIF($A$2:A2,A2)>1

Only the start of the range is locked, so it grows by one row each time. A2 counts within A2:A2, A4 within A2:A4, and so on.

ABC
1NameEmailClass
2Maya Chenmaya@mail.comYoga
3Leo Parkleo@web.comSpin
4Maya Chenmaya@mail.comPilates
5Sam Reyessam@shop.comYoga
6Leo Parkleo@web.comSpin
7Nia Brooksnia@mail.comSpin
8sam reyessam@shop.comYoga
9Omar Aliomar@web.comYoga
Only the later copies are colored: rows 4, 6 and 8.

This is the view to use before a clean-up, because the colored cells are exactly the ones you’d delete.

Highlight the whole row

To color the entire sign-up instead of just the name, select every column, A2:C9, and add a $ before the column letter of the cell you check:

=COUNTIF($A$2:$A,$A2)>1

Colors rows 2, 3, 4, 5, 6 and 8 from column A to column C.

Without the $ in $A2, the rule would check column B for the cells in column B and column C for the cells in column C. With it, every cell in the row looks at the name in column A.

Match on two columns

Signing up twice isn’t always a mistake. Maya Chen joined two different classes. To flag only people who signed up for the same class twice, use COUNTIFS, which needs every pair to match:

=COUNTIFS($A$2:$A,$A2,$C$2:$C,$C2)>1

Applied to A2:C9, it colors rows 3 and 6 (Leo Park, Spin) and rows 5 and 8 (Sam Reyes, Yoga). Maya’s rows stay plain.

ABC
1NameEmailClass
2Maya Chenmaya@mail.comYoga
3Leo Parkleo@web.comSpin
4Maya Chenmaya@mail.comPilates
5Sam Reyessam@shop.comYoga
6Leo Parkleo@web.comSpin
7Nia Brooksnia@mail.comSpin
8sam reyessam@shop.comYoga
9Omar Aliomar@web.comYoga
Same person, same class: rows 3, 5, 6 and 8.

Add another range and value pair for each extra column that has to match, for example $B$2:$B,$B2 to compare emails too.

Compare two lists

To color names in one list that also appear in another, count them in the other list. With the main list in column A and a waitlist in column E, select A2:A and use:

=COUNTIF($E$2:$E,A2)>0

Colors every name in column A that is also somewhere in column E. Here the test is above 0, not above 1, because you’re counting in a different list.

A conditional formatting rule can’t point at another tab directly. Wrap the range in INDIRECT and type the tab name in quotes: =COUNTIF(INDIRECT("Waitlist!A2:A"),A2)>0.

Capitals and stray spaces

COUNTIF ignores capitals, which is why “sam reyes” in row 8 was colored along with “Sam Reyes” in row 5. That’s usually what you want, since it catches the same person typed two ways.

If capitals should count as different, use EXACT, which compares letter for letter, and add up the matches with SUMPRODUCT:

=SUMPRODUCT(--EXACT($A$2:$A,A2))>1

Now rows 5 and 8 stay plain, because “Sam Reyes” and “sam reyes” no longer match.

Extra spaces work the other way. “Leo Park ” with a space at the end isn’t counted as “Leo Park”, so a real duplicate stays plain. Select the column and run Data > Data cleanup > Trim whitespace, or clean it with TRIM.

Change or remove the highlight

  • Edit a rule: select any colored cell, open Format > Conditional formatting, and click the rule to change its formula, range or color.
  • Remove it: in the same panel, point at the rule and click the trash icon. The colors go and your data stays exactly as it was.
  • Several rules on one range: the one higher in the list wins when two of them color the same cell. Drag a rule to reorder it.

Ready to delete them?

The highlight only shows you the duplicates. When you’ve checked them and want them gone, how to remove duplicates in Google Sheets covers the built-in tool, which deletes the repeat rows, and UNIQUE, which builds a clean copy and leaves the original alone.

Frequently asked questions

Does Google Sheets have a built-in rule for duplicates?

No. Conditional formatting in Google Sheets has no ready-made duplicates option. Choose Custom formula is and enter =COUNTIF($A$2:$A,A2)>1, changing the column to match your data.

Why is my highlight one row off?

The cell in your formula doesn’t match the first cell of the range. If the rule applies to A1:A, the formula has to check A1, not A2. Make the two start on the same row.

How do I highlight the whole row when there’s a duplicate?

Select all the columns, for example A2:C100, and lock the column in the cell you check: =COUNTIF($A$2:$A,$A2)>1. The dollar sign before A makes every cell in the row check column A.

How do I highlight duplicates across two columns?

To flag rows where two columns both match, use =COUNTIFS($A$2:$A,$A2,$B$2:$B,$B2)>1. To color values in one column that also appear in another, use =COUNTIF($B$2:$B,A2)>0.

Can I highlight duplicates from another sheet?

Yes, but the rule has to reach the other tab through INDIRECT, for example =COUNTIF(INDIRECT("Sheet2!A2:A"),A2)>0. A direct reference to another tab isn’t allowed in conditional formatting.

How do I delete the duplicates once they’re highlighted?

Use Data > Data cleanup > Remove duplicates, or build a clean copy with UNIQUE. Both are covered step by step in how to remove duplicates in Google Sheets.

Lessons for the formulas in this guide

Become a spreadsheet expert

Hands-on lessons and drills on a real practice sheet take you from beginner to expert. The first 18 lessons are free, and Pro unlocks the rest for a one-time $49.99.