To remove duplicate rows in Excel, click inside your data, go to Data > Data Tools > Remove Duplicates, tick the columns that define a duplicate and select OK. Excel keeps the first occurrence of each row and deletes the later copies. Copy your data first, because the change is permanent once you save.
| Method | Changes the data? | Versions | Use it when |
|---|---|---|---|
| Data > Remove Duplicates | Yes, deletes rows | All versions | One-off clean-up |
| Data > Advanced > Unique records only | No, filters or copies | All versions | You want to keep the original |
=UNIQUE() formula |
No, builds a live list | Excel 2021, 2024, Microsoft 365 | The source keeps changing |
| Conditional Formatting > Duplicate Values | No, highlights only | All versions | You want to review first |
How do I remove duplicate rows in Excel?
Use the Remove Duplicates command on the Data tab. It compares the columns you choose and deletes every later row that matches an earlier one.

- Select the range, or click any cell inside an Excel table.
- Go to Data and, in the Data Tools group, select Remove Duplicates.
- Leave My data has headers ticked if row 1 holds column names.
- Under Columns, tick only the columns that decide whether two rows are the same. Use Select All for exact full-row duplicates.
- Select OK. Excel reports how many duplicates it removed and how many unique values remain.
Here is an example. With only Email ticked, row 4 is removed because it repeats row 2's email, even though the order number differs:
| A (Email) | B (Order) | C (Product) | |
|---|---|---|---|
| 2 | sam@example.com | 1001 | Office 2024 |
| 3 | lee@example.com | 1002 | Windows 11 Pro |
| 4 | sam@example.com | 1003 | Visio 2024 |
With all three columns ticked, nothing is removed, because no two rows match on every column. Microsoft's guide to filtering for unique values or removing duplicates notes that the whole row goes, not only the ticked cells, and that the tool won't run on outlined data or data with subtotals.
What we commonly see: "duplicates" that Remove Duplicates refuses to remove. Usually one copy has a trailing space, a non-breaking space or a lookalike character hidden in it. Excel compares what is displayed, so "Sam " and "Sam" are different. Clean the column first with TRIM, as covered in our guide to removing spaces and characters, then run the tool again. Dates are similar: 08/03/2026 and 8 Mar 2026 are treated as unique if they are formatted differently.
Is there a formula in Excel to remove duplicates?
Yes. In Excel 2021, Excel 2024 and Microsoft 365, the UNIQUE function returns a de-duplicated copy of a range that updates when the source changes.

=UNIQUE(A2:A100) unique values from one column
=UNIQUE(A2:C100) unique full rows
=UNIQUE(A2:A100,,TRUE) values that appear exactly once
=SORT(UNIQUE(A2:A100)) unique values, sorted A to Z
The result spills down into empty cells. If anything is in the way, you get a #SPILL! error. Our guide to the #SPILL! error shows how to clear it. UNIQUE doesn't exist in Excel 2019 or 2016. There, use Data > Advanced, choose Copy to another location, tick Unique records only and give a destination cell. That copies the unique rows without touching the original.
How do I find duplicates with an Excel duplicate formula?
The standard Excel duplicate formula is COUNTIF. It tells you how many times a value appears, so you can review duplicates before deleting anything.

=COUNTIF($A$2:$A$100,A2)>1 TRUE if A2 appears more than once
=COUNTIF($A$2:A2,A2)>1 TRUE only for the 2nd, 3rd... copies
=IF(COUNTIF($A$2:A2,A2)>1,"Duplicate","")
The second version uses an expanding range, so the first occurrence returns FALSE and only the repeats are flagged. Filter on TRUE and you can delete exactly the rows Remove Duplicates would remove. To match on two columns, use COUNTIFS, as explained in our COUNTIFS with multiple criteria guide: =COUNTIFS($A$2:A2,A2,$B$2:B2,B2)>1.
For a quick visual duplicate search, select the column and choose Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Then filter by colour to see them together.
Advanced nuance: COUNTIF is case-insensitive and treats wildcards in the criteria as patterns. A value such as A*1 will match A11, AB1 and so on. If your codes contain asterisks or question marks, use =SUMPRODUCT(--($A$2:$A$100=A2))>1 instead, which compares values exactly (apart from case).
How do I duplicate a row or a cell in Excel?
To duplicate a row, copy it and insert the copy rather than pasting over existing data.
- Select the row number to highlight the whole row and press Ctrl+C.
- Right-click the row number below where the copy should go.
- Choose Insert Copied Cells. Excel shifts the rows down and inserts the duplicate.
To duplicate a cell into the cells below, select the cell and the empty cells under it and press Ctrl+D (Fill Down). Ctrl+R fills right. To duplicate rows many times, select several rows before copying. For more on inserting and moving rows, see our guide to inserting, deleting and moving rows and sheets.
How do I duplicate a tab in Excel?
To duplicate a tab, hold Ctrl and drag the sheet tab to a new position, then release the mouse before the key. Excel creates a copy named, for example, "Sales (2)". The menu route is right-click the tab > Move or Copy, pick where it goes, tick Create a copy and select OK. On a Mac, hold Option while dragging.
What does "This workbook has many duplicate styles" mean?
It means the workbook has collected a large number of repeated cell styles, usually from copying sheets between files over the years. Each paste can bring in styles such as "Normal 2" or "Good 3". Too many make the file slow and can trigger "Too many different cell formats" errors.
- Open Home > Cell Styles to see the custom styles listed at the top.
- Right-click an unwanted custom style and choose Delete. Cells using it revert to Normal.
- For hundreds of styles, a short macro that deletes every style that isn't built in is faster. Save a backup first.
Copy data with Paste Values where you can, to avoid importing more styles. If the file is badly bloated or unstable, our guide to repairing a corrupted Excel file can help.
Which Excel versions have UNIQUE?
Remove Duplicates, Advanced Filter and conditional formatting work in every desktop version from Excel 2016 onwards. The UNIQUE function needs Excel 2021, Excel 2024 or Microsoft 365. Excel 2021 support ended on 13 October 2026, so if you rely on dynamic array formulas, Excel 2024 or Microsoft 365 is the supported choice. See the Office 2024 collection for the editions that include Excel.
Frequently asked questions
Can I undo Remove Duplicates?
Yes, press Ctrl+Z straight away and the deleted rows come back. Once you close the workbook after saving, though, the removed rows are gone for good. That's why it's worth copying the sheet first, using Ctrl and drag on the sheet tab, or working on a UNIQUE formula copy instead of the original data.
Why is Remove Duplicates greyed out?
The most common causes are a protected sheet, a shared workbook, or cells in edit mode. Press Esc to leave the cell, then check Review > Unprotect Sheet. The command also fails on data with subtotals or an outline, so remove those first through Data > Subtotal > Remove All and Data > Ungroup > Clear Outline.
How do I remove duplicates but keep the last occurrence?
Remove Duplicates always keeps the first match from the top. To keep the latest entry instead, sort the data so the newest rows come first, for example by date from newest to oldest, and then run Remove Duplicates. In Microsoft 365 and Excel 2024 you can also flip a range with SORTBY before applying UNIQUE.
How do I clear duplicates without deleting the rows?
Add a helper column with =COUNTIF($A$2:A2,A2)>1, filter it to TRUE, select the visible cells in the duplicate column and press Delete. Only the contents of the repeat cells are cleared, and the rows stay in place. Clear the filter afterwards to see the full table again.
Does Remove Duplicates work in Excel for Mac?
Yes. On a Mac it is on the Data tab as Remove Duplicates, and the dialog works the same way. Conditional formatting, Advanced Filter and COUNTIF also behave the same. UNIQUE is available on Mac in Excel 2021, Excel 2024 and Microsoft 365.
Related guides
- How to delete blank rows in Excel
- COUNT, COUNTA and counting text in Excel
- How to clear or remove filters in Excel
- How to alphabetise in Excel
Links in this guide
| Link | Type | Why it helps |
|---|---|---|
| Microsoft Support: Filter for unique values or remove duplicates | External | Official steps for Remove Duplicates and Advanced Filter |
| Microsoft Support: UNIQUE function | External | Syntax and supported versions for UNIQUE |
| Remove spaces and dashes in Excel | Internal | Clean hidden spaces that stop matches |
| #SPILL! error in Excel | Internal | Fix blocked UNIQUE results |
| COUNTIFS with multiple criteria | Internal | Flag duplicates across two columns |
| Insert, delete and move rows and sheets | Internal | More row and sheet handling |
| Repair a corrupted Excel file | Internal | Help for bloated or unstable workbooks |
| Office 2024 collection | Internal | Office editions with UNIQUE |
| Delete blank rows in Excel | Internal | The next clean-up step |
| COUNT and COUNTA in Excel | Internal | More counting formulas |
| Clear filters in Excel | Internal | Reset filters after reviewing duplicates |
| Alphabetise in Excel | Internal | Sort before keeping first or last rows |
