Spreadsheet Practice

How to find duplicates in a column in Excel

Formula (Excel and Google Sheets)

=IF(COUNTIF($A$2:$A$10,A2)>1,"Duplicate","")

Count each value in the whole column: =IF(COUNTIF($A$2:$A$10,A2)>1,"Duplicate",""). Any value that appears more than once is flagged.

Result on the example
one result per row in B2, filled down to B10
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in B2, filled down to B10. Change any input and the result updates, or edit the formula to experiment.

How it works

COUNTIF counts how many times the email in this row appears in the whole list. The list is locked with $ so it stays the same as you fill down, while A2 moves to each row. More than one means the email is repeated, and every copy gets flagged.

=IF(COUNTIF($A$2:$A$10,A2)>1,"Duplicate","")

Result"Duplicate"

  1. $A$2:$A$109 rows × 1 col: "ana@northwind.example", "ben@contoso.example", "cara@fabrikam.example", "ana@northwind.example", …

    A range: 9 cells in one column.

  2. A2"ana@northwind.example"

    The value in A2.

  3. COUNTIF($A$2:$A$10,A2)3

    COUNTIF: Counts cells that meet one condition.

    • range$A$2:$A$109 rows × 1 col: "ana@northwind.example", "ben@contoso.example", "cara@fabrikam.example", "ana@northwind.example", …
    • criteriaA2"ana@northwind.example"
  4. COUNTIF($A$2:$A$10,A2)>1TRUE

    The > operator tests greater than.

  5. IF(COUNTIF($A$2:$A$10,A2)>1,"Duplicate","")"Duplicate"

    IF: Returns one value if a test is true, another if false.

    • logical_testCOUNTIF($A$2:$A$10,A2)>1TRUE
    • value_if_true"Duplicate"
    • value_if_false""not used

In Google Sheets

The same formula works in Google Sheets: =IF(COUNTIF($A$2:$A$10,A2)>1,"Duplicate",""). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=COUNTIF($A$2:$A$10,A2)>1TRUE, TRUE, FALSE…Different resultReturns TRUE or FALSE, which you can filter on or use in conditional formatting. TRUE and FALSE instead of labels.

Common mistakes

  • Without $ the range shrinks as you fill down, and later duplicates are missed.
  • COUNTIF ignores case and treats "ana@…" and "ANA@…" as the same. Extra spaces make them different; TRIM first.
  • COUNTIF with text longer than 255 characters returns #VALUE!. Use SUMPRODUCT(--(range=A2)) for long text.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Find duplicates in a column

In B2, show "Duplicate" when the email appears more than once in A2:A10, otherwise leave it blank. Fill down to B10.

Questions

How do I highlight duplicates instead?

Use the test as a conditional formatting rule: =COUNTIF($A$2:$A$10,A2)>1.

How do I flag only the second and later copies?

Count from the top to the current row: =IF(COUNTIF($A$2:A2,A2)>1,"Repeat","").

Checked by running on 2026-10-29: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.