How to Delete Duplicates in Excel: 5 Methods That Work

To delete duplicates in Excel, click inside your data, go to the Data tab, select Remove Duplicates, tick the columns Excel should compare, and click OK. Excel keeps the first occurrence of each row and permanently deletes the rest — so copy your data to another sheet before you start.
That one button solves most duplicate problems in under a minute. But it is not always the right tool: it changes your data in place, it cannot be undone once the workbook is saved and closed, and it keeps the first copy rather than the newest one. This guide covers five methods — from the quick built-in button to the UNIQUE function and Power Query — so you can pick the one that matches your version of Excel and the result you actually want. All steps are verified against Microsoft Support documentation as of November 2026.
At a Glance: Which Method Should You Use?
| Method | Best for | Changes your original data? | Excel versions |
|---|---|---|---|
| Remove Duplicates (Data tab) | Deleting repeats fast, in place | Yes — permanent | All modern Excel versions |
| Conditional Formatting | Finding duplicates before you delete anything | No — highlights only | All modern Excel versions |
| UNIQUE function | A live, auto-updating clean list | No — builds a new list | Microsoft 365, Excel 2021, Excel 2024, Excel for the web |
| Advanced Filter | A one-off clean copy elsewhere | No — copies unique records out | All modern Excel versions |
| Power Query | Repeatable cleaning of large or imported data | No — transforms a copy | Excel 2016 and later (built in); Excel 2010/2013 as an add-in |
Before You Delete Anything: Back Up Your Data
Microsoft Support is blunt on this point: when you use the Remove Duplicates feature, the duplicate data is permanently deleted. Its advice is to copy or move the original data to another worksheet before you remove anything.
The fastest backup takes five seconds: right-click the sheet tab, choose Move or Copy, tick Create a copy, and click OK. You now have an untouched original to fall back on. Pressing Ctrl+Z immediately after a removal also restores the deleted rows, but only while the workbook is still open — once you save and close, Undo is gone.
It also helps to tidy the data first. Remove Duplicates treats values as identical only when they match exactly, so “Smith” and “Smith ” (with a trailing space) count as different entries. A quick pass with TRIM to strip extra spaces, and consistent capitalization, prevents the tool from missing duplicates that look identical to you.
Method 1: How Do I Delete Duplicates With Remove Duplicates?

This is the standard answer, and the one Microsoft documents first. It works in Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019, Excel 2016, and Excel for the web.
- Click any cell inside your data, or select the full range. If your data has headers, include them in the selection.
- On the Data tab, in the Data Tools group, select Remove Duplicates.
- If you selected a single column that has data beside it, Excel asks whether to expand the selection. Choose Expand the selection so whole rows are compared and deleted together. Choosing “Continue with the current selection” deletes cells from that one column only and misaligns your rows.
- In the Remove Duplicates dialog, leave My data has headers ticked if your first row contains column names.
- Under Columns, tick the columns that together define a duplicate. Use Select All to compare every column, or Unselect All and then tick just the ones that matter — for example, tick only “Email” if one row per email address is what you want.
- Click OK. Excel reports how many duplicate values were removed and how many unique values remain.
Two details catch people out. First, when duplicates are removed, the first occurrence of the value is kept and the later copies are deleted — Microsoft states this explicitly. Second, data is removed from all columns, even columns you did not tick: if a row matches on your chosen columns, the entire row goes. That is why the backup matters.
One more limitation from Microsoft: you cannot remove duplicates from data that is outlined or has subtotals. Remove the outline (Data > Ungroup > Clear Outline) or the subtotals (Data > Subtotal > Remove All) first, then run the tool.
Method 2: How Do I Find Duplicates Before Deleting Them?
If you are not sure the repeats are safe to delete, highlight them first and look. Conditional formatting changes nothing in your data — it only colors the cells.
- Select the cells you want to check — a single column is the usual choice.
- On the Home tab, select Conditional Formatting > Highlight Cells Rules > Duplicate Values.
- Keep Duplicate selected in the first box, pick a format (the default light red fill works well), and click OK.
Every value that appears more than once is now highlighted, including the first occurrence. Scan the highlighted cells: genuine duplicates stand out, but so do legitimate repeats, such as the same product name on different orders. This preview step is what separates a careful cleanup from an accidental data loss.
Microsoft notes one limitation: Excel cannot highlight duplicates in the Values area of a PivotTable report. Run the check on the source data instead.
Counting Duplicates With a Formula
If you want a count rather than a highlight, add a helper column with =COUNTIF($A$2:A2,A2) copied down. Any row where the result is greater than 1 is a repeat of an earlier row. Filter that helper column for values above 1 and you have a list of every duplicate row, ready to review or delete.
Method 3: How Do I Use the UNIQUE Function to Remove Duplicates?
The UNIQUE function is the cleanest option on current Excel: one formula produces a duplicate-free list, the source data is never touched, and the list updates itself when the source changes.
Type this in an empty cell, with enough empty cells below it for the results:
=UNIQUE(A2:A500)
The results “spill” downward automatically. To sort the list at the same time, wrap it: =SORT(UNIQUE(A2:A500)). To return only values that appear exactly once — excluding anything repeated at all — use the third argument: =UNIQUE(A2:A500,,TRUE).
The full syntax, as Microsoft documents it, is =UNIQUE(array, [by_col], [exactly_once]). Only the first argument is required. Set by_col to TRUE to compare columns instead of rows.
Which Excel Versions Have UNIQUE?
UNIQUE is a dynamic array function, and it only exists in newer Excel. Microsoft lists it for Excel for Microsoft 365, Excel 2024, Excel 2021, Excel for the web, and the current mobile apps. Excel 2019 and earlier do not have it — typing the formula there returns a #NAME? error. If you share files with people on older Excel, a UNIQUE formula will break for them, so Remove Duplicates or Advanced Filter is the safer choice for shared workbooks.
Two other errors to know: #SPILL! means something is blocking the cells the results need to flow into — clear the cells below the formula. #CALC! means the input range is empty.
Method 4: How Do I Remove Duplicates With Advanced Filter?
Advanced Filter is the old-school way to build a clean copy without touching the original, and it works in every version of Excel.
- Click inside your data.
- On the Data tab, in the Sort & Filter group, select Advanced.
- Choose Copy to another location.
- Tick Unique records only.
- Set the Copy to box to an empty cell where the clean list should start, and click OK.
Microsoft’s distinction is worth remembering: filtering for unique values only hides duplicates temporarily, while Remove Duplicates deletes them permanently. Advanced Filter with “Copy to another location” sits between the two — your original stays intact and the clean list is a separate, static copy. Unlike UNIQUE, it does not update when the source changes.
Method 5: How Do I Remove Duplicates in Power Query?
Power Query is the right tool when the same messy data arrives again and again — a weekly export, a downloaded CSV, a report you refresh every month. You set the steps once, and every refresh repeats them.
- Click inside your data and select Data > From Table/Range. Confirm the range and whether it has headers.
- In the Power Query Editor, select the column or columns that define a duplicate.
- On the Home tab, in the Reduce Rows group, select Remove Rows > Remove Duplicates.
- Select Close & Load to write the cleaned table back to Excel.
Power Query keeps the first occurrence, like Remove Duplicates. Its advantage is repeatability: when the source data updates, one Refresh re-runs the whole cleanup, including any other steps you added, such as trimming spaces or changing data types. Power Query is built into Excel 2016 and later on Windows; on a Mac, equivalent functionality arrived later, so check your version if you work on macOS.
How Do I Keep the Last Occurrence Instead of the First?
Remove Duplicates, UNIQUE, and Power Query all keep the first occurrence and drop the later ones. If the newest row is the one you want — the latest order, the most recent address — sort first so the row you want to keep sits on top.
Add a date or sequence column if you do not already have one, sort the data so the newest entries come first (largest to smallest on the date), and then run Remove Duplicates. The “first” occurrence is now the newest row, and the older copies are the ones deleted. Sort back into your preferred order afterwards if needed.
Common Mistakes When Deleting Duplicates in Excel

Deleting without a backup. The single most common regret. Copy the sheet first — it takes five seconds and there is no other way back once the file is saved.
Forgetting the headers checkbox. If “My data has headers” is unticked when your data has headers, Excel may treat the header row as data and delete it if it matches another row. If it is ticked when there are no headers, your first data row is excluded from the comparison.
Selecting one column out of a table. Deleting duplicates from a single column while the rest of the row stays put scrambles your data. Always expand the selection so whole rows move together.
Trailing spaces and invisible characters. “Acme Ltd” and “Acme Ltd ” are different values to Excel. Use =TRIM() and, for non-breaking spaces pasted from the web, =CLEAN() or Find and Replace before you deduplicate.
Case differences that are not differences. Remove Duplicates is not case-sensitive: “SMITH” and “smith” count as duplicates. That is usually what you want, but be aware of it when case carries meaning in your data.
Numbers stored as text. A number stored as text does not match the same number stored as a value. If duplicates survive the tool, check for the green triangle in the cell corner that marks numbers stored as text, and convert them first.
Expecting exact counts. Microsoft notes that the counts of duplicate and unique values shown after removal might include empty cells and cells containing only spaces, so do not treat the reported totals as a perfect headcount.
Which Method Is Best for Large Spreadsheets?
For a one-off cleanup of a few thousand rows, Remove Duplicates is fastest. For a list that keeps changing, UNIQUE is better because it stays live. For very large files — hundreds of thousands of rows — Power Query is the most reliable option: it processes the data outside the worksheet grid, handles the load without freezing the interface, and records every step so the cleanup is repeatable and auditable. If your file is slow to open or recalculate, move the deduplication into Power Query rather than running formulas across the whole sheet.
Frequently Asked Questions
How do I delete duplicates in Excel but keep one copy?
Use Data > Remove Duplicates. Excel keeps the first occurrence of each row and deletes the later copies. Copy your data to another sheet first, because the deletion is permanent once the workbook is saved and closed.
How do I remove duplicates in Excel without deleting the original data?
Use the UNIQUE function (=UNIQUE(A2:A500)) on Microsoft 365, Excel 2021, or Excel 2024 — it builds a new, live list and never touches the source. On older versions, use Data > Advanced Filter with “Copy to another location” and “Unique records only” ticked.
Why is Remove Duplicates grayed out in Excel?
The most common cause is a shared workbook or a protected sheet. Unshare the workbook or unprotect the sheet and try again. Outlined or subtotaled data also blocks the feature — remove the outline or subtotals first, as Microsoft documents.
Does Remove Duplicates keep the first or the last occurrence?
It keeps the first occurrence, counting from the top of the range, and deletes the later copies. To keep the newest row instead, sort the data so the newest entries come first, then run Remove Duplicates.
Why does Excel say there are no duplicates when I can see them?
Usually the values are not truly identical: a trailing space, a non-breaking space, different capitalization in a formula comparison, or numbers stored as text. Use TRIM to strip extra spaces and convert text-numbers to real numbers, then run the tool again.
Can I remove duplicates from only one column?
Yes. Select just that column, then choose “Continue with the current selection” when Excel asks. But be careful: deleting cells from one column only will misalign the rows around it. In most cases you should expand the selection so whole rows are removed together.
Last updated: November 2026. Steps verified against Microsoft Support’s guide to removing duplicates. For more step-by-step how-to guides, see our walkthrough of the best free online file converters and our reference guide on how many ounces are in a liter.

