Excel Find Duplicate Lines

This guide treats “excel find duplicate lines” the way busy spreadsheet users actually want it: answer first, a live tool to prove it on your own data, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: add a helper column with =IF(COUNTIF(A:A,A2)>1,"Duplicate","Unique"), then filter that column to "Duplicate" to list every repeat.

On this page7
ƒxDuplicate RemoverLive
Unique values
3

2 duplicates removed · 3 kept

Runs entirely in your browser — your data never leaves this page.
=IF(COUNTIF(A:A,A2)>1,"Duplicate","Unique")
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

The fastest way to locate duplicates without changing your data is a COUNTIF helper column. COUNTIF(A:A,A2) counts how many times the value in A2 appears in the whole column; if that count is above 1, the value is repeated. Wrapping it in IF turns each row into a plain "Duplicate" or "Unique" flag you can then filter, sort or count — a reversible, auditable trail that leaves the original column untouched. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “excel find duplicate lines”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected duplicates change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a data step that keeps your analysis trustworthy useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

A column A2:A11 of order IDs reads 1001, 1002, 1003, 1004, 1005, 1004, 1006, 1007, 1003, 1008. In B2 enter =IF(COUNTIF(A:A,A2)>1,"Duplicate","Unique") and fill down. Both rows holding 1004 and both holding 1003 are flagged "Duplicate"; every other row reads "Unique". Switch on a filter and pick "Duplicate" to see only the four repeated rows. When you need to investigate duplicates rather than silently delete them — auditing IDs, reconciling imports, chasing down why a total is off — a COUNTIF flag is the transparent tool: every repeat is listed, countable and reversible. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “excel find duplicate lines” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Locking the wrong reference — keep A2 relative so it moves down, but use a whole-column range like A:A (or an absolute $A$2:$A$100).
  • Trailing spaces or mixed case hiding true matches; COUNTIF is case-insensitive but spaces still split values, so clean with TRIM first.
  • Expecting the helper column to delete anything — it only flags; removing rows is Data ▸ Remove Duplicates.
  • Pointing COUNTIF at a single cell instead of the full column, so nothing is ever counted as repeated.

Frequently asked questions

How do I flag only the second and later occurrences?

Use a growing range: =IF(COUNTIF($A$2:A2,A2)>1,"Duplicate","") marks every repeat after the first, leaving the original unflagged.

Can I find duplicates across two columns?

Combine the keys first: =IF(COUNTIFS(A:A,A2,B:B,B2)>1,"Duplicate","Unique") treats a row as duplicate only when both columns match.

Does this change my data?

No. A helper column is purely additive — delete the column and your original list is exactly as it was.