The fastest way to remove duplicates in Excel

Excel has a built-in tool that finds and removes duplicate rows in seconds. Select the data range you want to check, go to the Data tab, click Remove Duplicates, and choose which columns to compare. Excel will delete the duplicate rows and show you how many it removed.

This works best when your data is organized in a table with headers — one row at the top that names each column. If your data doesn't have headers, tell Excel that before you start, or it will treat your first row as a header and skip it.

The Remove Duplicates tool compares entire rows by default, but you can narrow it down. If you only care whether certain columns match (for example, you want to keep only one entry per customer name even if the order dates differ), you can uncheck the columns you want to ignore.

Key Takeaways

  • The Data tab's Remove Duplicates button deletes rows where all selected columns match, and tells you how many rows it removed.
  • You must select your data first — the tool only works on what you highlight, not the whole sheet.
  • If your data has headers, check the "My data has headers" box so Excel doesn't treat your first row as a duplicate candidate.
  • You can choose which columns to compare, so you can keep one entry per customer even if other details differ.
  • Remove Duplicates permanently deletes rows, so save a copy of your file first if you want to keep the original.

How to use Remove Duplicates step by step

Start by selecting all the data you want to check. Click the cell in the top-left corner of your data, then hold Shift and click the cell in the bottom-right corner. This selects the entire rectangle. If your data has headers, include them in your selection.

Go to the Data tab at the top of the ribbon. Look for the Remove Duplicates button — it's usually in the Data Tools group. Click it. A dialog box will open showing all the columns in your selection.

If your data has a header row, check the box that says My data has headers. This tells Excel to ignore the first row when looking for duplicates. Then look at the list of columns. By default, all columns are checked. Uncheck any column you want Excel to ignore when comparing rows.

Click OK. Excel will scan your data, delete the duplicate rows, and show a message telling you how many duplicates it found and removed. The remaining rows stay in the same order they were in before.

When to use Remove Duplicates versus other methods

Remove Duplicates is the right choice when you have a straightforward list and you want to keep just one copy of each unique entry. It's fast, built-in, and requires no formulas. Use it for customer lists, product inventories, or any table where each row represents one item and you only want to see each item once.

If you need to see duplicates without deleting them — for example, to review them before deciding what to do — use the Filter feature instead. Select your data, go to Data > Filter, and click the dropdown arrow in any column header. You can then sort or hide rows based on their values.

If you want to flag duplicates in a new column so you can decide which ones to keep, use a formula like COUNTIF. This is slower than Remove Duplicates but gives you more control. For example, you could add a column that counts how many times each customer name appears, then manually delete the rows you don't want.

What happens if you remove duplicates by mistake

Remove Duplicates deletes rows permanently. If you realize you made a mistake right after running it, press Ctrl+Z (or Cmd+Z on Mac) to undo. Excel will restore the deleted rows immediately.

If you've already saved the file or closed it, the undo won't work. This is why it's a good idea to save a copy of your file before using Remove Duplicates. That way, if something goes wrong, you still have the original data.

Handling duplicates across multiple columns

Sometimes you need to find duplicates based on only some of your columns, not all of them. For example, you might have a list of orders where the same customer appears multiple times with different order dates. If you want to keep only one row per customer, you would uncheck the "Order Date" column before running Remove Duplicates.

When you uncheck a column, Excel ignores it when deciding whether a row is a duplicate. So if two rows have the same customer name but different dates, Excel will treat them as duplicates and delete one. The row that stays is the first one it encounters — you can't control which one.

If you need to keep the row with the most recent date, or the highest value, or some other criteria, Remove Duplicates won't do that. In those cases, you'll need to sort your data first (newest dates at the top, for example) before running Remove Duplicates. That way, the row you want to keep will be first, and Excel will delete the others.

Removing duplicates from a single column

If you only want to check one column for duplicates, select just that column before opening Remove Duplicates. Excel will compare only the values in that column and delete any row where the value repeats.

Be careful with this approach: if you select only one column, Excel will delete entire rows based on that column alone, even if the other columns contain different information. For example, if you select only a "Name" column and there are two people named "John Smith" with different addresses, Excel will delete one of the entire rows, not just the duplicate name.

Frequently Asked Questions

Does Remove Duplicates work on filtered data?

No. Remove Duplicates works on all rows in your selection, including hidden ones. If you've filtered your data to show only certain rows, Remove Duplicates will still process the hidden rows. To remove duplicates from only the visible rows, you need to delete the hidden rows first or copy the visible rows to a new sheet.

Can I remove duplicates based on partial matches?

No. Remove Duplicates looks for exact matches only. If one cell says "John Smith" and another says "john smith" (different capitalization), Excel treats them as different values. If you need to match partial text or ignore capitalization, you'll need to clean up your data first or use a formula-based approach.

What if I want to keep all duplicates and just mark them?

Use a COUNTIF formula instead. In a new column, enter =COUNTIF($A$2:$A$100,A2) to count how many times each value appears. Any value that appears more than once will show a number greater than 1. You can then filter or sort by this column to see all duplicates together.

Does Remove Duplicates work the same way in Google Sheets?

Google Sheets has a similar feature called "Remove duplicates" under the Data menu, but it works slightly differently. It removes rows where all columns match, and you can't uncheck individual columns. For more control in Google Sheets, use the UNIQUE function or filter your data manually.

Can I undo Remove Duplicates after I close the file?

No. Once you close the file without saving, or save it after running Remove Duplicates, the undo history is gone. Always save a backup copy of your data before removing duplicates, so you have the original if something goes wrong.