How to Remove Duplicates in Excel (Keep First, Delete Rest)

Published October 18, 2026 · By Ahmad Parvez

Short answer: click anywhere in your data, go to the Data tab → Remove Duplicates → choose which columns to compare → OK. Excel keeps the first occurrence of every value and deletes the rest, then tells you how many duplicates it removed. Work on a copy first — once you save and close, there is no undo.

Duplicate rows sneak into every spreadsheet: pasted lists, merged exports, sign-up forms submitted twice. This guide covers how to remove duplicates in Excel the fast way, how to find duplicates before you delete anything, and the edge cases that trip people up — case-sensitivity, invisible spaces, merged cells, and the "entire row vs. one column" choice that changes everything. It also clears up a common mix-up: several "duplicate" searches are actually about copying a sheet or file, which is a different thing entirely (covered near the end).

How to remove duplicates in Excel: the 3-click method

This is the built-in button most people are looking for, and it works the same in Excel for Microsoft 365, Excel 2021, Excel 2019 and Excel for the web:

  1. Select your data. Click any cell inside the table, or drag-select the exact range you want to dedupe. Selecting a range yourself is safer than clicking one cell — Excel guesses the boundary of your data, and a stray blank row can make it guess wrong (more on that below).
  2. Data tab → Remove Duplicates. It sits in the Data Tools group, next to Text to Columns. In Excel for the web, the path is the same: Data → Remove Duplicates.
  3. Choose columns, then OK. A dialog lists every column with a checkbox. Checked columns are the ones Excel compares: two rows count as duplicates (duplicate records) only if all checked columns match. Leave everything checked to remove only fully identical rows. Click OK, and Excel reports the result, e.g. "3 duplicate values found and removed; 97 unique values remain."

One detail worth knowing: the "My data has headers" checkbox at the top of that dialog. If your first row is a header, leave it checked so Excel doesn't treat it as data. If your data has no header row and you leave it checked, the first data row gets excluded from comparison — and if a duplicate lived there, it survives.

How to remove duplicate rows in Excel (entire row vs. selected columns)

The column checkboxes in the Remove Duplicates dialog are the single most misunderstood part of the feature. They answer the question: what counts as a duplicate?

"Uncheck a column only when you genuinely don't care about the data in it. Checking just the Email column to dedupe a customer list will delete rows that had different order totals attached."— The rule of thumb for the column dialog.

Practical advice: if you only care about one column but the rest of the row matters, don't uncheck everything — find the duplicates first (next section), review them, and delete manually or with a filter. Getting rid of duplicates in Excel is easy; getting rid of the right duplicates takes one extra minute of checking.

How to remove duplicates in a column in Excel

When you only want to dedupe a single column — say a list of emails or product SKUs:

  1. Select just that column (click its letter header, e.g. column A).
  2. Data → Remove Duplicates. The dialog will show only that column checked.
  3. Click OK.

Warning: removing duplicates from a column deletes entire rows, not just the cell. If column B has notes attached to the deleted rows, those notes are gone too. If the surrounding data matters, use the highlight-and-filter method below instead, so you can see what's attached before anything disappears.

How to find and identify duplicates in Excel before you delete anything

Smart workflow: look for duplicates first, then decide whether to delete them. There are two reliable ways — a no-formula visual method and a formula method.

Method 1: Conditional Formatting (no formulas)

  1. Select the range where you want to search for duplicates.
  2. Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values. (Same path in Excel for the web.)
  3. Pick a color format and click OK. Every value that appears more than once is colored; unique values stay untouched.

This is also how you show duplicates, view duplicates, mark duplicates or flag duplicates in Excel — it is the same feature under different names. To find duplicate names specifically, select just the name column before applying it. To find duplicates across multiple columns, select the whole table: any value repeated anywhere in the selection gets highlighted.

Want to act on the highlighted cells? Select the range, then Home → Sort & Filter → Custom Sort → Sort Options → sort by Cell Color (choose the duplicate color first). Now all duplicates sit together, and you can review or delete them as a group. That covers "how to sort duplicates in Excel" and "how to sort out duplicates" too.

Method 2: The COUNTIF formula

Add a helper column next to your data with this formula (assuming data starts in A2):

=COUNTIF($A$2:$A$100, A2)>1

The $ signs lock the range so it doesn't shift as you fill down. The formula returns TRUE for every value that appears more than once. Then Data → Filter on the helper column for TRUE — there's your duplicate list, without deleting a thing. To find duplicate rows across two columns (say first name in A and last name in B), use COUNTIFS instead:

=COUNTIFS($A$2:$A$100, A2, $B$2:$B$100, B2)>1

For a ready-made version, the Excel Formula Builder generates the COUNTIF and COUNTIFS flagging formulas for your exact ranges — plus the UNIQUE formula below. Its COUNTIF and UNIQUE entries explain each argument step by step.

How to highlight duplicates in Excel (and what to do next)

Highlighting deserves its own section because it answers a different question than deleting: where are my duplicates? The core path is Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values, and a few refinements make it far more useful:

How to filter out duplicates in Excel (hide them without deleting)

Sometimes you don't want to delete duplicates — you want them out of sight. Two options:

Advanced Filter: "Unique records only"

  1. Select your data, then go to Data → Sort & Filter → Advanced.
  2. Check "Unique records only" and click OK. Excel hides the duplicate rows in place — the data is still there, just filtered from view. Clear the filter (Data → Clear) to bring them back.
  3. Alternatively, choose "Copy to another location" in the same dialog and check "Unique records only": Excel extracts a clean, deduped list to a new spot, leaving the original untouched.

Note: Advanced Filter is a desktop-Excel feature; Excel for the web doesn't have it. And like Remove Duplicates, its comparison is case-insensitive.

The UNIQUE formula (Microsoft 365 / Excel 2021+)

If your Excel is current, the cleanest way to view a deduplicated list is a single formula:

=UNIQUE(A2:A100)

It spills a list of each value once — no deletions, no dialogs, and it updates automatically when the source changes. Wrap it in SORT for an alphabetical clean list: =SORT(UNIQUE(A2:A100)). This is the modern answer to "how to filter duplicates in Excel" and "how to eliminate duplicates" for reporting.

How to find duplicates in Excel with multiple columns

Real-world duplicates are rarely one column. Two customers named "Ahmad Parvez" are different people if their phone numbers differ. Three approaches, from simplest to most robust:

Edge cases most guides skip (read this before you click OK)

This is where duplicate removal goes wrong in practice. Every one of these is real behavior in Excel:

How to combine, merge, and count duplicates in Excel

Not every duplicate problem is a deletion problem. Sometimes you want to consolidate duplicates — add up the repeat orders per customer, or count how many times each value appears:

The Excel Formula Builder generates the COUNTIF, COUNTIFS, SUMIF and UNIQUE formulas above for your exact ranges, with a how-to for each.

A different kind of "duplicate": copying a sheet, file, or cells

A big chunk of "duplicate" searches mean copying, not deduping. Quick answers so you land in the right place:

Frequently asked questions

Can I remove duplicates in Excel but keep one copy?

Yes — that is exactly what the Remove Duplicates button does. It keeps the FIRST occurrence of each value and deletes every later copy, so one of each remains. If you need to keep a different copy (for example the most recent order per customer), sort your data first so the row you want to keep comes first, then run Remove Duplicates.

How do I find duplicates in Excel without deleting them?

To identify duplicates in Excel without deleting anything, use Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values, which colors every repeat. Or add a helper column with =COUNTIF($A$2:$A$100, A2)>1 (adjust the range to your data) and filter for TRUE — the TRUE rows are your duplicates, and nothing has been deleted.

Why doesn't Excel find my duplicates? They look identical.

Almost always invisible differences: a trailing space ('Apple ' vs 'Apple') is the classic culprit. Clean the column first with =TRIM(A2), then paste the results back as values (Paste Special → Values) before removing duplicates. Case differences never matter — 'Apple' and 'apple' already count as duplicates. Numbers stored as text ('123' vs 123) also fail to match; convert the column to one type first.

Can I undo Remove Duplicates in Excel?

Yes, immediately: press Ctrl+Z (Cmd+Z on Mac) right after running it and your deleted rows come back. But once you save AND close the workbook, the deletions are permanent. Always run Remove Duplicates on a copy of your data — duplicate the sheet first (right-click the sheet tab → Move or Copy → Create a copy) so the original stays untouched.

How do I remove duplicates from two merged Excel files?

Stack both datasets into one sheet (paste one under the other, making sure the columns line up), then run Data → Remove Duplicates on the combined range. For a repeatable process, use Power Query: Data → Get Data → Combine Queries → Append the two tables, then Home → Remove Rows → Remove Duplicates. Excel for the web can append ranges manually but has no Power Query; paste-and-dedupe works there too.

How do I count duplicates in Excel?

The fastest way is a PivotTable: select your data → Insert → PivotTable, drag the field into both Rows and Values — each unique value appears with its count, and anything above 1 is a duplicate. With a formula, =COUNTIF(A:A, A2)-1 tells you how many extra copies of the value in A2 exist beyond the first. The Excel Formula Builder generates both the counting and flagging formulas for you.

How do I check for duplicates in a column in Excel?

Select the column, then use Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values to color every repeat instantly. For a column you can sort and filter, add a helper column with =COUNTIF($A$2:$A$100, A2)>1 and filter for TRUE. To check while typing, add Data → Data Validation → Custom with the formula =COUNTIF($A:$A, A1)=1, which rejects entries that would create a duplicate.

Is Excel's duplicate detection case-sensitive?

No — Excel's Remove Duplicates, conditional formatting, and COUNTIF are all case-insensitive, so 'Apple', 'APPLE' and 'apple' count as the same value. If case matters to you, use a helper column with =SUMPRODUCT(--EXACT($A$2:$A$100, A2))>1, because the EXACT function is case-sensitive, then filter for TRUE.

How do I duplicate an Excel file?

To duplicate an Excel file (the whole workbook), use File → Save a Copy — this saves a second file and leaves the original untouched. In Excel for the web, use File → Save As → Save a Copy. If you only need a copy of one sheet inside the same workbook, right-click the sheet tab → Move or Copy → check Create a copy → OK.

Keep your clean data clean

Deduping is half the job — the other half is stopping duplicates from coming back. These guides pick up where this one leaves off:

And for the formulas behind flagging, counting and extracting uniques, see the Excel Formula Builder — guided COUNTIF, COUNTIFS, SUMIF and UNIQUE builders with copy-ready formulas.