The quickest way to remove duplicates in Excel is the built-in command. Click any cell in your data, go to the Data tab, click Remove Duplicates (in the Data Tools group), choose which columns must match, and click OK. Excel keeps the first copy of each row, deletes the later ones, and tells you how many it removed. The shortcut on Windows is Alt, A, M, pressed one after another.
That command works in Excel for Microsoft 365, Excel 2024, 2021, 2019, and 2016 on Windows, in recent Excel for Mac versions, and in Excel for the web. It permanently deletes rows, so copy your data to another sheet first. If you’d rather keep the original untouched, the UNIQUE function, Advanced Filter, and Power Query methods below build a clean copy instead.
On this page
- Before you start: three quick checks
- Remove duplicates with the Data tab command
- How column choices change what gets deleted
- Highlight duplicates first, delete later
- Keep the original with the UNIQUE function
- Copy unique rows with Advanced Filter
- A formula method for Excel 2019 and earlier
- Power Query for data you clean every week
- When duplicates won’t go away
- Checking the result and undoing mistakes
- Answers to common questions
Before you start: three quick checks
- Make a backup. Right-click the sheet tab, choose Move or Copy, tick Create a copy, and click OK. You can also save the workbook under a new name. Ctrl+Z works right after removal, but not once the file is closed.
- Remove subtotals and outlines. Remove Duplicates won’t run on outlined or subtotaled data. Go to Data > Subtotal > Remove All and Data > Ungroup > Clear Outline first.
- Know which row you want to keep. Excel keeps the first occurrence from the top. If you want the newest record to survive, sort the data newest-first before you remove duplicates.
Remove duplicates with the Data tab command
Here’s a small customer list with some repeats. Rows 5 and 8 are exact copies of rows 2 and 3, and row 7 shares an email with row 4 but has a different city.
| Row | A: Name | B: Email | C: City |
|---|---|---|---|
| 1 | Name | City | |
| 2 | Lena Ortiz | [email protected] | Denver |
| 3 | Marcus Bell | [email protected] | Austin |
| 4 | Priya Nair | [email protected] | Seattle |
| 5 | Lena Ortiz | [email protected] | Denver |
| 6 | Tom Reyes | [email protected] | Boston |
| 7 | Priya Nair | [email protected] | Portland |
| 8 | Marcus Bell | [email protected] | Austin |
These steps are for Excel for Microsoft 365 on Windows. The Mac and web versions follow.
- Select the data. Click any single cell inside the list. Excel selects the whole connected block automatically. If your sheet has other data right next to it, drag to select only A1:C8 instead.
- Open the command. Go to the Data tab and click Remove Duplicates in the Data Tools group. On a narrow window, the group may be collapsed into a single Data Tools button; click it to find the command. The Remove Duplicates dialog box opens.
- Confirm the header setting. If row 1 holds labels, make sure My data has headers is ticked. The column list then shows Name, Email, and City instead of Column A, Column B, and Column C. If you leave it unticked, Excel treats your header row as data.
- Choose the columns that define a duplicate. Leave all three ticked to remove only rows that match in every column. Use Select All and Unselect All to change many boxes at once.
- Click OK. A message appears, such as “2 duplicate values found and removed; 5 unique values remain.” Click OK to close it.
With all three columns ticked, Excel deletes rows 5 and 8. Row 7 stays, because Portland doesn’t match Seattle. The remaining rows move up to close the gap, so you won’t see blank rows where the duplicates were.
If your data is an Excel table
Click a cell in the table, then go to the Table Design tab (called Table or Design in some versions) and click Remove Duplicates in the Tools group. The Data tab button works on tables too. The dialog and results are the same.
Excel for Mac
Select a cell in the data, then on the Data tab click Remove Duplicates. Tick the columns to compare, confirm the header option, and confirm with the button at the bottom of the dialog. Microsoft documents this for Excel for Microsoft 365 for Mac, Excel 2024 for Mac, and Excel 2021 for Mac.
Excel for the web
Open the workbook in your browser, click a cell in the data, then select Data > Remove Duplicates. The same dialog appears with a header checkbox and column list. Because changes save automatically online, copy the sheet first; you can still undo right away, or restore an earlier copy from the file’s version history.
How column choices change what gets deleted
The checkboxes decide what counts as a match, but Excel always deletes the entire row of the selected range, including columns you didn’t tick. This is the part that catches people out.
| Columns ticked | Rows removed from the sample | Why |
|---|---|---|
| Name, Email, City | 5 and 8 | Only exact repeats across all three columns. |
| Email only | 5, 7, and 8 | Row 7’s email matches row 4, so it goes even though the city differs. The Portland address is lost. |
| City only | 5 and 8 | Denver and Austin repeat. In a real list this could delete different people who live in the same city. |
Tick only the columns that truly identify a record, such as an email address, order number, or employee ID. Leave out notes, timestamps, and amounts unless a difference in them really means a different record.
Warning: don’t select a single column of a multi-column list and run Remove Duplicates on just that column. If Excel shows a Remove Duplicates Warning asking whether to Expand the selection or Continue with the current selection, choose Expand the selection. Continuing removes cells from that one column only, which shifts its values up and misaligns them with the rest of each row.
Highlight duplicates first, delete later
If you want to see the repeats before anything disappears, color them first. This doesn’t change any data.
- Select the column or range to check, such as B2:B8.
- Go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
- Leave the first box set to Duplicate, pick a color from the values with list, and click OK.
Every value that appears more than once is shaded, including the first copy. To review only those rows, turn on Data > Filter, click the column’s arrow, choose Filter by Color, and pick the highlight color. This rule looks at single cells, so it highlights repeated emails, not whole repeated rows. To remove the coloring later, go to Home > Conditional Formatting > Clear Rules. If you also work in Google Sheets, the idea is similar to comparing two columns in Google Sheets to spot shared values.
Keep the original with the UNIQUE function
In Excel for Microsoft 365, Excel 2024, Excel 2021, and Excel for the web, the UNIQUE function builds a duplicate-free copy that updates whenever the source changes.
- Click an empty cell with plenty of blank space below and to the right, such as E2.
- Type
=UNIQUE(A2:C8)and press Enter.
Excel fills E2:G6 with the five unique rows. This is called spilling: only E2 contains the formula, and the rest of the result flows into the neighboring cells. Other useful versions:
=UNIQUE(B2:B8)returns a list of distinct emails only.=SORT(UNIQUE(A2:A8))returns distinct names in A to Z order.=UNIQUE(A2:A8,,TRUE)returns only names that appear exactly once (here, Tom Reyes). The empty middle argument keeps the default row-by-row comparison.=UNIQUE(FILTER(B2:B100,B2:B100<>""))skips blank cells so they don’t appear as an empty entry in the list.
If you see #SPILL!, something is blocking the cells the result needs. Clear them or move the formula. UNIQUE also won’t spill inside a formatted Excel table, so place it in ordinary cells. To turn the live result into plain values, copy it and use Home > Paste > Paste Values.
Copy unique rows with Advanced Filter
Advanced Filter works in every desktop version, including Excel 2016 and 2019, and leaves your original list alone.
- Click a cell in the data.
- Go to Data and click Advanced in the Sort & Filter group.
- In the Advanced Filter box, choose Copy to another location.
- Check that List range shows your data including the header row, such as
$A$1:$C$8. Leave Criteria range empty. - Click in the Copy to box, then click the top-left cell where the clean list should go, such as E1 on the same sheet.
- Tick Unique records only. Without this box, Advanced Filter just copies everything.
- Click OK.
Unique rows, with headers, appear starting at E1. The copy is a snapshot: if the source changes, run the filter again. Choosing Filter the list, in-place instead hides the duplicate rows without deleting them; clear it with Data > Clear. When copying, Excel expects the destination to be on the sheet that’s active when you open Advanced Filter, so to send the results to another sheet, start the command from that destination sheet.
A formula method for Excel 2019 and earlier
Without UNIQUE, a helper column can flag repeats so you can filter and delete them on your own terms.
- In D1, type a heading such as Copy #.
- In D2, enter
=COUNTIF($B$2:B2,B2)and fill it down to D8. The expanding range counts how many times each email has appeared so far, so the first copy shows 1 and later copies show 2, 3, and so on. - To check several columns together, compare a combined key instead:
=COUNTIFS($A$2:A2,A2,$B$2:B2,B2,$C$2:C2,C2). - Turn on Data > Filter, open the Copy # arrow, and show only values greater than 1.
- Select the visible rows by their row numbers, right-click, and choose Delete Row. Only the filtered rows are removed.
- Clear the filter and delete the helper column.
This approach is slower than the built-in command, but it lets you see exactly which rows will go before you delete them.
Power Query for data you clean every week
If you import the same export every week or month, Power Query can repeat the cleanup with one click. It’s built into Excel for Microsoft 365, 2024, 2021, 2019, and 2016 on Windows.
- Click a cell in your data and go to Data > From Table/Range (in the Get & Transform Data group). Confirm the range and header setting if Excel asks to create a table.
- In the Power Query Editor, select the columns that define a duplicate. Hold Ctrl and click headers to pick several, or press Ctrl+A for all.
- On the editor’s Home tab, in the Reduce Rows group, click Remove Rows > Remove Duplicates. Right-clicking a selected header and choosing Remove Duplicates does the same thing.
- Click Home > Close & Load. The cleaned data lands on a new sheet as a table.
Next time the source data changes, go to Data > Refresh All and the deduplicated table updates. Note that Power Query compares text with case sensitivity, so “Lena” and “lena” count as different, unlike the Data tab command. If capitalization shouldn’t matter, select the column first and use Transform > Format > lowercase before removing duplicates.
When duplicates won’t go away
| Problem | Likely cause | Fix |
|---|---|---|
| “No duplicate values found” but you can see repeats | Hidden spaces at the end of some entries, nonprinting characters from pasted data, or numbers stored as text next to real numbers. | Add a helper column with =TRIM(CLEAN(B2)), fill down, copy, and Paste Values over the original. Convert text-numbers with the warning icon’s Convert to Number. |
| Two identical-looking dates aren’t treated as duplicates | Remove Duplicates compares what the cell displays. 3/8/2026 and Mar 8, 2026 look different, so they count as unique. | Apply the same number format to the whole column first. |
| Same item in two separate lists isn’t removed | The lists were selected as side-by-side columns, so Excel compared rows, not the lists. | Stack both lists into one column, then run the command. |
| Remove Duplicates is grayed out | The sheet is protected, the workbook is in an older shared-workbook mode, a cell is being edited, or several sheets are grouped. | Press Esc, unprotect the sheet (Review > Unprotect Sheet), right-click a tab and choose Ungroup Sheets, or turn off legacy sharing. |
| Error about outlines or subtotals | The range contains grouped rows or subtotals. | Use Data > Subtotal > Remove All and clear the outline. |
| Blank rows disappeared | Fully blank rows count as duplicates of each other. | Exclude blank rows from the selection, or fill them before running the command. |
| The wrong record was kept | Excel keeps the topmost copy. | Undo, sort so the preferred version is on top, and run it again. |
| Data in other columns no longer lines up | “Continue with the current selection” was chosen for a single column. | Press Ctrl+Z immediately, then rerun with the full range selected. |
For stubborn stray spaces in a code or ID column, Find and Replace in Excel can replace a space with nothing across the whole selection in one go. Microsoft’s own reference on filtering for unique values or removing duplicates explains the displayed-value rule and the outline restriction in more detail.
Checking the result and undoing mistakes
Look at the count Excel reports. If it says far more were removed than you expected, press Ctrl+Z (on a Mac, Command+Z) right away. Undo works only before you make other changes and only while the file is open, which is why the backup copy matters.
To double-check, select the column you deduplicated on and look at the Count on the status bar at the bottom of the window, then compare it with the original. You can also re-apply the Duplicate Values highlight; if nothing lights up, the cleanup worked. If you saved over a file stored in OneDrive or SharePoint, File > Info > Version History lets you open an earlier version.
Answers to common questions
Does Remove Duplicates delete the first or the second copy?
It keeps the first copy (the one nearest the top of the range) and deletes the later ones. Sort first if you want a specific version kept.
Is Remove Duplicates case-sensitive?
No. “Austin” and “AUSTIN” are treated as the same value. Power Query’s Remove Duplicates, by contrast, does treat different capitalization as different values.
Can I remove duplicates in one column without deleting the whole row?
Yes, but it’s risky in a table of related data. Select only that column and choose Continue with the current selection when warned. Values in that column shift up and no longer line up with their original rows. For a standalone list, that’s fine; for a table, use =UNIQUE() on the column instead.
How do I delete both copies, leaving only values that appear once?
The built-in command always keeps one copy. Use =UNIQUE(range,,TRUE) in newer versions, or the COUNTIF helper column with a whole-range count, =COUNTIF($B$2:$B$8,B2), then filter for values greater than 1 and delete those rows.
Can I remove duplicates across several sheets?
Not in one step. Copy the lists onto one sheet, one under another, then run Remove Duplicates. For a repeatable version, load each sheet into Power Query, use Append Queries, and remove duplicates there.
Can I stop duplicates from being typed in the first place?
Yes. Select the column (for example B2:B500), go to Data > Data Validation, choose Custom, and enter =COUNTIF($B$2:$B$500,B2)=1. Excel then blocks any entry that already exists in that range.
Does this work the same way in Google Sheets?
Google Sheets has its own tool under Data > Data cleanup > Remove duplicates, and a different trick is needed if you want to avoid rows shifting. See removing duplicates in Google Sheets without shifting cells. If shifting rows is not a concern, the standard Sheets route, plus the UNIQUE function, is covered in how to remove duplicates in Google Sheets.
What to do next
Practice on a copy of a real list: highlight duplicates first, then run Remove Duplicates with only your ID column ticked and compare the count with what you expected. If you clean the same export often, set it up once in Power Query and simply refresh it each time.
Matthew Simpson has been creating online tutorial for computers and smartphones since 2010. His work has been read millions of times and helped people to solve a number of various tech problems. His specialties include Windows, iPhones, and Google apps.