Find duplicates in a list
Paste names, e-mails, order numbers or anything else, one per line. Each repeated value is flagged next to the list, and the summary shows which values repeat.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Values | Duplicate? | Summary | |
| 2 | Anna | Duplicate | Values | 10 |
| 3 | Ben | Duplicate | Distinct values | 7 |
| 4 | Chloe | Duplicate | Extra copies | 3 |
| 5 | Ben | Duplicate | Values that repeat | Anna, Ben, Chloe |
| 6 | David | |||
| 7 | Emma | |||
| 8 | anna | Duplicate | ||
| 9 | Frank | |||
| 10 | Chloe | Duplicate | ||
| 11 | Gina |
Blue cells are inputs: type a new value and the sheet recomputes. Click a result to see its formula.
How it works, step by step
=IF(COUNTIF(A$2:A$501,A2)>1,"Duplicate","") =COUNTA(UNIQUE(FILTER(A2:A501,A2:A501<>""))) =TEXTJOIN(", ",TRUE,UNIQUE(FILTER(A2:A501,COUNTIF(A2:A501,A2:A501)>1))) =UNIQUE(FILTER(A2:A501,A2:A501<>"")) The same formula on your Sheets data
On a store's live orders, the number of orders minus the number of distinct customers counts the repeat orders: every order after a customer's first.
=data.orders.count(id)-data.orders.countd(customer_id) Functions used here
More free tools
Questions
How do I find duplicates in a spreadsheet?
Put =COUNTIF(A:A,A2)>1 next to the first value and fill it down: TRUE marks a value that appears more than once. Wrap it in IF to show a word instead, as in the sheet above. The same formula works in every common spreadsheet app.
Does it treat upper and lower case as the same?
Yes. COUNTIF and UNIQUE ignore case, so "Anna" and "anna" count as the same value. For a case-sensitive check, compare with EXACT: =SUMPRODUCT(--EXACT(A$2:A$501,A2))>1.
How do I count how many duplicates there are?
Count all values with COUNTA and the distinct ones with COUNTA(UNIQUE(...)). The difference is the number of extra copies: 10 names with 7 distinct means 3 extra copies.
How do I remove duplicates but keep the first one?
=UNIQUE(range) returns each value once, in the order it first appears. Copy its result and paste it as values if you want to replace the original list.
Do spaces matter?
Yes: "Ben" and "Ben " (with a trailing space) are different values. In a sheet, clean the list first with =TRIM(A2). The tool above trims the start and end of each pasted line the same way.
Run these formulas on live data
Sheets is a spreadsheet with 491 functions that reads your store, accounting or project data live, builds dashboards and e-mails reports on a schedule.