The fastest way to delete duplicates in Excel is Data > Remove Duplicates, which scans your selected columns, keeps the first occurrence of each row, and reports exactly how many rows it removed. That tool permanently deletes data with no undo, so use it only after you've confirmed which columns define a duplicate. When you need a preview first, or your "duplicates" are near-matches rather than exact copies, Conditional Formatting and formulas are safer. This guide walks through five methods in the order most people should try them, with the edge cases that trip up each one.
What Excel Actually Counts as a Duplicate Row
Excel treats two rows as duplicates only when every value in the columns you selected matches exactly. Case doesn't matter for text ("apple" and "APPLE" collide), but invisible differences do: a trailing space in "Smith " versus "Smith" makes those cells distinct, and so does a number stored as text versus a real number. Blank cells count as matching values, which means two rows that are both empty in a selected column can be flagged as duplicate pairs even when the rest of the row differs β a frequent source of surprise deletions. Remove Duplicates compares values, not formatting, so coloring one row yellow changes nothing about how it's judged.
The column selection is the whole ballgame. If you select the entire table, only fully identical rows qualify. If you select a single column, Excel deletes every row that repeats a value in that column and keeps the first, discarding the other data in those rows without asking. That's why the dialog warns you it will "permanently delete" rows β there's no Undo for this operation, only closing without saving or restoring from a backup or version history. According to Microsoft's support documentation for the feature, the deletion is irreversible in the workbook itself, which is why the preview-based methods below exist.
Data size matters too. Remove Duplicates handles large ranges efficiently, but it runs on the active sheet's selection only β it can't sweep several sheets in one pass. And it works on values in cells, so formulas that return identical text are treated as duplicates of each other even though the underlying formulas differ. If you're deduplicating a workbook where some columns are calculated, decide whether those formulas should participate in the match before you run anything.
The practical upshot: define your duplicate key before you touch a tool. Ask which columns together identify a unique record β typically an email address, an order number, or a name-plus-date combination. Everything in this article builds on that decision, and getting it wrong is the one mistake no tool can undo for you.
Method 1: Remove Duplicates in Five On-Screen Steps
This is the default path for a clean, exact-match dedupe, and it takes under a minute on most sheets. The feature lives on the Data tab in the Data Tools group in every current Excel edition β Microsoft 365, Excel 2021, 2019, and 2016 β and the dialog looks the same across them. It works on Windows and Mac; the Mac ribbon places it in the same Data Tools group.
1: Click any single cell inside your data range. Excel auto-detects the contiguous block and expands the selection to the whole table, including the header row. 2: Go to Data on the ribbon and click Remove Duplicates in the Data Tools group. 3: In the dialog, confirm My data has headers is ticked if row 1 holds column names β this keeps the header out of the comparison and lets you check columns by name. 4: Tick only the columns that define a duplicate. For a contact list, that's usually Email alone; for an order log, Order ID. Leave the rest unticked so their values are carried along with the surviving row. 5: Click OK, then read the result box: it names how many values were found and how many duplicates were removed and how many unique values remain.
Read that result box carefully before you save. If the removed count is wildly higher than you expected, close the workbook without saving and reopen it β that's your only rollback with this method. The dialog also lets you sort before deleting by clicking a column header in the same window, but sorting changes which row survives as the "first" occurrence, so skip it unless you deliberately want a particular record kept.
Failure handling: if Excel says "No duplicates found" when you can see them, your selection probably missed rows (a blank row splits a range) or invisible characters are defeating the match. Press Ctrl+Z immediately after clicking OK β in many Excel builds the deletion does register as a single undoable action, but Microsoft doesn't guarantee it across versions, so treat undo as a bonus, not a plan. The reliable recovery path is File > Info > Version History on a OneDrive-saved file, or a saved copy made beforehand.
Method 2: Preview Duplicates With Conditional Formatting Before You Delete
Highlighting first turns a blind deletion into a reviewed one, and it's the method I'd push anyone toward when the data is hard to recreate. Select your range, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, and pick a fill color. Every value that appears more than once in the selected cells lights up, including the first occurrence, so you see entire duplicate clusters rather than just the extras. That visibility is the point: you can eyeball whether the flagged rows really are redundant before anything is removed.
The limitation is that this rule matches single cells, not whole rows. To flag duplicate rows across several columns, add a helper column with a formula such as =COUNTIF(A$2:A2,A2)>1 next to your data, where A holds the column that defines uniqueness; fill it down, and every repeat after the first returns TRUE. Filter that column for TRUE and you have a clean list of exactly the rows Remove Duplicates would delete β a preview the built-in tool never gives you. Delete those filtered rows manually, or keep them aside in a scratch sheet.
Once you've confirmed the flagged set, delete the visible rows and clear the formatting. If you filtered rather than deleting, remember to remove the filter before you sort or share the file. One edge case: Conditional Formatting evaluates blanks as duplicates of each other, so a column with many empty cells will light up heavily and tell you nothing useful β restrict the range to populated rows or add a rule condition that ignores blanks.
This route costs you a helper column and a couple of minutes, and in exchange you get a record of what was about to disappear. For a payroll export or a customer list, that trade is almost always worth it. For a throwaway scratch sheet, skip straight to Method 1.
Method 3: Filter, Then Delete the Visible Rows
Filtering gives you surgical control over which copy survives, which Remove Duplicates can't offer. Add the helper formula from the previous section, turn on Data > Filter (Ctrl+Shift+L), and filter the helper column to TRUE. What remains visible is every duplicate beyond the first occurrence. Select those rows, right-click the row numbers, and choose Delete Row β Excel removes only the visible ones and leaves the hidden originals intact, a behavior you can verify by clearing the filter afterward.
Watch one failure case closely: deleting rows in a filtered list can behave differently depending on whether you delete entire rows via the row headers or just cell contents. Deleting cell contents of a filtered selection writes into hidden rows in some Excel versions, silently corrupting records you never saw. Always delete whole rows from the row-number gutter, not from a cell selection. And never drag-fill or paste across a filtered range for the same reason.
The filter method also lets you keep the newest record instead of the first. Sort by a date column descending before filtering, and the helper formula's "first occurrence" becomes the most recent entry. That's the right call for subscription lists, price logs, and anything where recency signals truth. It's a small step that most quick dedupe tutorials skip entirely.
If your sheet carries merged cells, stop and unmerge them first. Filters and row deletion interact badly with merged ranges, and Excel may refuse to filter or delete rows at all. Unmerge, fill the values down so every row carries its own data, then proceed. Five minutes of cleanup prevents an afternoon of reconstruction.
Choosing Your Duplicate Key: Exact vs Fuzzy Matching
Exact matching is what all the built-in tools do, and it's the right default. But a real contact list contains "Jon Smith" and "John Smith," or two spellings of the same company with different suffixes. Excel's native tools will never merge those, and no amount of clicking will change that. Recognizing which problem you have decides your method before you start.
| Method | Match Type | Preview Before Delete | Undo Available | Best For |
|---|---|---|---|---|
| Remove Duplicates | Exact values only | No | Not guaranteed | Clean exact-match tables |
| Conditional Formatting | Exact cell values | Yes (highlight) | Yes (formatting only) | Reviewing before deletion |
| Filter + delete rows | Exact, via helper formula | Yes (filtered view) | Yes (Ctrl+Z, unsaved) | Keeping newest or chosen record |
| UNIQUE function | Exact values | Yes (output spills) | Yes (formula, not data) | Excel 365 and 2021, live dedupe |
| Power Query | Exact by default; fuzzy option | Yes (query preview) | Yes (query steps) | Repeatable imports, fuzzy merges |
The UNIQUE function, available in Microsoft 365 and Excel 2021, spills a deduplicated copy of a range into empty cells without touching the source: =UNIQUE(A2:C100) returns unique rows, and =UNIQUE(A2:A100) returns unique values from one column. Because it's a formula, the result updates when the source changes, and you delete nothing. Older perpetual editions β Excel 2019 and earlier β don't have it, so check your version before relying on it.
Fuzzy matching lives only in Power Query, under Home > Merge Queries with the "Use fuzzy match" option and a similarity threshold you set, commonly 0.8 or higher. That's the tool for near-duplicates, and it returns candidate pairs you approve manually rather than deleting anything on its own. Anyone promising one-click fuzzy dedupe in native Excel is describing something that doesn't exist.
Method 4: Keep a Live Deduplicated Copy With UNIQUE
If your source list keeps growing, a formula beats a one-time deletion. In a blank area of the sheet or a new tab, enter =UNIQUE(YourRange) and Excel spills the distinct rows there, updating automatically as the source changes. The original data stays untouched, so there's nothing to undo and nothing to recover. For a mailing list that gets appended weekly, this is the lowest-risk setup available.
Pair it with SORT for a tidy output β =SORT(UNIQUE(A2:D500)) β and the spill reorders alphabetically each time the source shifts. The one condition to respect: the spill range needs empty cells to expand into. If anything sits in the way, you get a #SPILL! error, and Excel highlights the blocking cells. Clear them and the formula recalculates on its own.
Excel 2021 and Microsoft 365 support these dynamic arrays; Excel 2019 doesn't, and a legacy array-entry workaround exists but is clunky enough that most people should upgrade or use Power Query instead. Also note the spill range is a formula result, not data β if you need to send the deduplicated list to someone, copy it and paste as values first.
The formula approach quietly solves the biggest weakness of every deletion method: it's reversible by deleting the formula. No backup ritual, no version history hunting. The trade-off is that it doesn't clean the source, so if downstream reports read the original range, they still see every duplicate. Point those reports at the spill range, or accept that the clean copy is a separate view.
Method 5: Power Query for Repeatable and Fuzzy Deduplication
Power Query is the professional path when deduplication is a recurring job β a monthly export from a CRM, say. Load your table with Data > From Table/Range, then in the Power Query editor use Home > Remove Rows > Remove Duplicates, choosing the key columns in the same way as Method 1. Every action is recorded as a step on the right-hand pane, so the whole cleanup replays on next month's file with one refresh: Data > Refresh All.
The advantage over Remove Duplicates is the audit trail. You can click any step to see the data at that moment, reorder steps, or delete one that was wrong β nothing is final until you click Close & Load. If a step deleted more than it should, remove the step and the rows return. That's a fundamentally different safety model from the native tool's permanent deletion, and it's why analysts handling regulated or financial data default to it.
For near-duplicates, Merge Queries with fuzzy matching set to a similarity threshold (0.8 is a common starting point; raise it for stricter matching) produces a table of candidate pairs that you review and merge deliberately. Nothing is auto-deleted. Expect some false positives at any threshold β "Smith Ltd" and "Smith Inc" can score high β so review the pairs rather than trusting the score blindly.
Setup cost is real: the first query takes maybe fifteen minutes to build. Run it monthly for a year and that investment pays back many times over in avoided rework. For a one-off cleanup of a small sheet, stick with Method 1 and skip the overhead.
The Mistakes That Turn a Cleanup Into a Data Loss
The single biggest error is selecting the wrong columns. Select a name column only, and Excel keeps one row per name while silently dropping distinct records that shared that name β different phone numbers, different orders, gone. The result box says it removed duplicates, and it did, just not the ones you meant. Decide your key columns on paper or in a scratch note before you open the dialog.
The second is trusting undo. Ctrl+Z often reverses a Remove Duplicates run in current Excel builds, but the feature's documentation describes the deletion as permanent, and behavior varies by version and by whether the workbook has been saved since. Never test your luck on data you can't recreate. Save a copy first, or keep the file on OneDrive so Version History gives you a restore point.
The third is ignoring whitespace and type mismatches. A column pasted from another system routinely carries trailing spaces, non-breaking spaces, or numbers stored as text. Those defeat every exact-match tool in this article. Clean first with TRIM (removes leading, trailing, and excess internal spaces) and check types with ISTEXT or by watching for left-aligned numbers, which Excel stores as text. Ten minutes of prep makes every method afterward behave predictably.
Fourth: running dedupe on a filtered or partially hidden sheet. Remove Duplicates operates on the selection, including hidden rows, so a filtered view can hide the very rows about to be deleted. Clear filters and show all rows first. Each of these mistakes is cheap to prevent and expensive to discover after saving.
Recovering Data After an Accidental Duplicate Deletion
Act fast, because your recovery options shrink with every save. The first move is Ctrl+Z β press it immediately, before touching anything else, and check whether the rows return. If they don't, close the workbook without saving. That preserves the last saved state, which is your cleanest fallback if the file was saved before the deletion.
If the file lives on OneDrive or SharePoint, open File > Info > Version History and restore a version from before the deletion. Microsoft 365 keeps versions automatically, though the retention window depends on your organization's settings β confirm the available history with your IT admin if you don't see an older version. For locally saved files, check Windows File History or your backup tool's restore points; Excel itself keeps no automatic backup of deleted rows.
When no backup exists, reconstruction is the only route: re-import from the original source system, or rebuild from any export you emailed or downloaded earlier. This is the moment the preview habits from Methods 2 and 3 prove their worth β a highlighted or filtered list would have shown you what was about to go. Build the habit now, on a sheet where the stakes are low.
A practical insurance policy costs nothing: before any dedupe run on important data, right-click the sheet tab, choose Move or Copy, tick Create a copy, and work on the duplicate. If the run goes wrong, delete the copy. It's a five-second habit that makes every method in this article reversible, whatever Excel's undo decides to do that day.
FAQ
Does Remove Duplicates delete the first or the last occurrence?
It keeps the first occurrence in the current row order and deletes every later match. Sort your data before running it if you want a specific record to survive β sorting by date descending, for example, makes the newest entry the one kept. The result box reports the count removed, not which rows, so verify with Conditional Formatting beforehand if the choice matters. There's no setting in the dialog to keep the last occurrence instead.
Why does Excel say no duplicates found when I can see them?
Invisible characters are the usual culprit. Trailing spaces, non-breaking spaces pasted from web pages, and numbers stored as text all make otherwise identical values compare as different. Run TRIM on text columns and check for text-formatted numbers before rerunning the tool. A blank row splitting your range can also cause Excel to analyze only part of the data, so select the full range manually.
Can I delete duplicates across multiple sheets at once?
Not with the built-in tool, which works on one sheet's selection per run. Power Query handles it: import each sheet as a query, append them into one table, then apply Remove Duplicates on the combined result. For a handful of sheets, running the tool once per sheet and then deduplicating the consolidated list is usually faster than building the query. Either way, the cross-sheet step needs a consolidation, not a single click.
What's the difference between Remove Duplicates and the UNIQUE function?
Remove Duplicates permanently alters your data in place; UNIQUE generates a separate deduplicated copy as a spilled formula and leaves the source untouched. UNIQUE requires Microsoft 365 or Excel 2021, while Remove Duplicates exists in every modern edition. If you need a live, self-updating clean view, use UNIQUE; if you need the source itself cleaned once, use the tool β with a backup.
Does Remove Duplicates work on formatted tables and pivot source data?
Yes on Excel Tables (created with Ctrl+T): the tool respects the table boundaries and header row. On pivot table source data, deduplicating after the pivot is built won't refresh the pivot automatically, and removing rows can leave the pivot pointing at a stale range. Refresh the pivot after deduplication, or dedupe the source before building the pivot. Check the pivot's source range under PivotTable Analyze if results look wrong.
How do I remove duplicates but keep the row with the most recent date?
Sort the table by your date column, newest first, before running Remove Duplicates, so the first occurrence Excel keeps is the most recent record. Alternatively, use the helper-formula and filter method and delete only the older visible rows. Power Query does it cleanly by sorting the date column descending as its first step, then removing duplicates on your key columns β the sort order determines which row survives.
Is there a way to count duplicates without deleting anything?
Yes. =COUNTIF(A:A,A2) in a helper column returns how many times each value appears, and anything above 1 marks a duplicate cluster. =SUMPRODUCT((COUNTIF(A2:A100,A2:A100)>1)*1) totals the cells involved in duplicates in one formula. Neither touches your data, which makes counting the right first step when you're unsure whether a dedupe is even warranted. Pair the count with Conditional Formatting for a visual check.
Will deduplicating break my formulas that reference other rows?
It can. Formulas using direct cell references like =A5*B5 will point at whatever row now occupies that position after deletion, silently returning wrong results. Structured references in Excel Tables adjust automatically, which is one reason to convert your range to a table before deduplicating. For critical models, copy the sheet, run the dedupe on the copy, and compare outputs before committing the change to the live file.