How to Remove Duplicates in Excel (3 Ways)
By ExcelReady TeamUpdated 5 min read
The short answer
To remove duplicates in Excel, click inside your data and go to Data > Remove Duplicates. Tick the columns that must match for a row to count as a duplicate, then click OK. Excel deletes the repeats and keeps the first copy. To keep the original data, use =UNIQUE(A2:C9) in Microsoft 365, or Data > Advanced with Unique records only.
Key takeaways
- Data > Remove Duplicates deletes repeated rows and keeps the first one; work on a copy.
- The columns you tick decide what counts as a duplicate: all columns, or just one ID column.
- =UNIQUE(range) builds a live list without duplicates and leaves the data untouched.
- Advanced Filter with Unique records only copies a clean list in any Excel version.
- Extra spaces make values different, so clean them with TRIM before removing duplicates.
On this page+
To remove duplicates in Excel, select your data and use Data > Remove Duplicates: Excel deletes repeated rows and keeps the first copy of each. If you'd rather not delete anything, the UNIQUE function or Advanced Filter builds a clean copy instead. This guide shows all three ways on one customer list, and how to choose which columns count as a duplicate.
What counts as a duplicate?#
A duplicate is a row whose values match another row in the columns you choose. That choice matters. Look at this list in A1:C9:
| A | B | C | |
|---|---|---|---|
| 1 | Customer | City | Plan |
| 2 | Acme | Leeds | Basic |
| 3 | Birch | York | Pro |
| 4 | Acme | Leeds | Basic |
| 5 | Cedar | Bath | Pro |
| 6 | Birch | Hull | Pro |
| 7 | Delta | York | Basic |
| 8 | Cedar | Bath | Pro |
| 9 | Acme | Leeds | Pro |
- Checking all three columns, rows 4 and 8 are duplicates. They match rows 2 and 5 exactly.
- Checking Customer only, rows 4, 6, 8 and 9 are duplicates, because Acme, Birch and Cedar already appeared.
Before deleting, it can help to see the repeats. The guide to highlighting duplicates colours them with one conditional formatting rule.
Way 1: The Remove Duplicates button#
This is the fastest way, and it changes the data in place. It works in every version of Excel on Windows and Mac.
- Make a copy of the sheet first: right-click the sheet tab and choose Move or Copy, then tick Create a copy.
- Click any cell inside the data.
- Go to Data > Remove Duplicates (Windows ribbon keys: Alt, A, M).
- Make sure My data has headers is ticked.
- Tick the columns that must match. Leave all ticked to compare whole rows.
- Click OK.
With all columns ticked, Excel reports that it found and removed 2 duplicate values and that 6 unique values remain. With only Customer ticked (click Unselect All, then tick Customer), it removes 4 rows and keeps one row each for Acme, Birch, Cedar and Delta.
Excel keeps the first row of each set, counting from the top. If you want to keep the newest record instead, sort the data newest first before removing duplicates. Press Ctrl+Z (Mac: ⌘Z) right away if the result is wrong.
Way 2: The UNIQUE function#
UNIQUE returns the list without repeats in a new place and leaves your data alone. It needs Microsoft 365, Excel 2021 or Excel 2024.
=UNIQUE(A2:C9)Type it in E2 and it spills six rows: the same result as Remove Duplicates on all columns. Because it's a formula, it updates when the data changes. Add another "Delta, York, Basic" row and extend the range, and the result still shows Delta once.
UNIQUE has two optional arguments:
| Formula | What it returns | Rows |
|---|---|---|
=UNIQUE(A2:A9) | Each customer once | 4 |
=UNIQUE(A2:C9) | Each distinct row once | 6 |
=UNIQUE(A2:C9,,TRUE) | Only rows that appear exactly once | 4 |
The last one is different from removing duplicates: it drops every copy of a repeated row, so Acme-Leeds-Basic and Cedar-Bath-Pro disappear completely. The UNIQUE function guide explains each argument. To refer to the whole result later, use the spill range operator, as in =ROWS(E2#); see how the # spill reference works.
Way 3: Advanced Filter with Unique records only#
Advanced Filter copies the unique rows to a new spot, and it works in every version, including Excel 2019 and older.
- Click inside the data and go to Data > Advanced (in the Sort & Filter group).
- Choose Copy to another location.
- Check that List range is
$A$1:$C$9. - In Copy to, click an empty cell, such as E1.
- Tick Unique records only and click OK.
Excel copies the headers and the six unique rows to E1:G7. The result is fixed values, so run it again if the data changes. To check one column only, set the List range to that column, such as $A$1:$A$9.
Which way should you use?#
Pick by whether you want to keep the original and whether the data will change:
| Need | Best way |
|---|---|
| Clean a list once, for good | Remove Duplicates |
| Keep the original and get a live list | UNIQUE |
| Keep the original in Excel 2019 or older | Advanced Filter |
| A list for a drop-down that updates | UNIQUE |
The side-by-side comparison of UNIQUE vs Remove Duplicates goes deeper. A UNIQUE list also makes a good source for dynamic drop-down lists, and it's the first step in summarizing data without a pivot table.
Why aren't my duplicates removed?#
Excel only removes values that match exactly. If duplicates survive, check for:
- Extra spaces. "Acme" and "Acme " (with a trailing space) are different. Clean the column with TRIM first.
- Numbers stored as text. 1001 as a number and "1001" as text don't match. Convert the text with Data > Text to Columns or VALUE.
- Different formats. Remove Duplicates compares what the cells display. The same date shown as 1/3/2024 in one cell and 1-Mar-2024 in another is not treated as a duplicate.
- Only one column selected. If you selected a single column and chose Continue with the current selection, Excel compares and changes only that column, which can push its values out of line with the rest of each row. Undo, click one cell and choose Expand the selection instead.
- Merged cells or subtotals. Remove them before you start.
Capital letters don't matter: Remove Duplicates and UNIQUE both treat "ACME" and "Acme" as the same value.
Practise it#
Cleaning duplicate rows is a standard task in data-entry and admin tests. Practise UNIQUE in a live spreadsheet: you type the formula and it checks it instantly. Then practise filtering a table to find and check repeats before you delete anything. Start with the exercise on this page.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Build a list with no repeated rows, without deleting anything. In E2, use UNIQUE on the whole table A2:C9 and press Enter.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Plan | |||||
| 2 | Basic | |||||
| 3 | Pro | |||||
| 4 | Basic | |||||
| 5 | Pro | |||||
| 6 | Pro | |||||
| 7 | Basic | |||||
| 8 | Pro | |||||
| 9 | Pro | |||||
| 10 | ||||||
| 11 | ||||||
| 12 |
Tip: UNIQUE only needs the range. Select all three columns, without the headers.
Practise this in a lesson
Frequently asked questions
How do I remove duplicates in Excel but keep the first one?
Use Data > Remove Duplicates. Excel always keeps the first row of each set of duplicates, counting from the top, and deletes the rest. Sort the data first if you want a particular row to be the one kept.
How do I remove duplicates based on one column?
In the Remove Duplicates box, click Unselect All, then tick only that column, such as Customer ID. Rows are then treated as duplicates when that one column matches, even if other columns differ.
How do I remove duplicates without deleting the data?
Use =UNIQUE(A2:C9) in Microsoft 365 or Excel 2021 and later, or Data > Advanced with Copy to another location and Unique records only. Both leave the original rows in place.
Why doesn't Remove Duplicates find my duplicates?
The values aren't exactly the same. Extra spaces, numbers stored as text, or different number formats make Excel see them as different. Clean the data with TRIM and consistent formats, then try again.
Can I undo Remove Duplicates?
Yes, press Ctrl+Z (Mac: Cmd+Z) straight away. Once you save and close the file, the deleted rows are gone, so make a copy of the sheet first.