FormulaCraft

How to flag duplicate values in Excel and Google Sheets

Topic:Duplicates & uniqueness
Excel & Google Sheets
=IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique")

Verified example

Computed by a real spreadsheet engine on the sample data below.

ItemStatus
Apple
Banana
Apple
Cherry
Banana

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

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In a helper column (e.g., B2), enter =IF(COUNTIF($A$2:$A$6,A2)>1,"Duplicate","Unique") — lock the range with $ so it doesn't shift when you copy down.
  2. 2Copy the formula down through all rows in your data (e.g., B2:B6).
  3. 3Filter or sort column B to group all 'Duplicate' entries together for easy review or deletion.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Does the formula catch duplicates that differ only in case?

Yes — COUNTIF is case-insensitive, so 'Apple' and 'apple' are treated as the same value.

Can I flag duplicates across two separate columns?

Yes — change the range to cover both columns, e.g. COUNTIF($A$2:$B$6,A2)>1.

More on Duplicates & uniqueness

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: