Excel has two built-in tools to find and remove duplicates

The fastest way to remove duplicates in Excel depends on what you're duplicating — entire rows or just values in a single column. Excel's Remove Duplicates feature deletes whole rows where all selected columns match. If you only want to remove duplicate values within one column and keep the first occurrence, use the Data > Filter > Standard Filter method or sort and delete manually. Both approaches work on the data you select, so you control exactly what gets checked.

The Remove Duplicates tool is faster if you have many rows and want to clean up your entire dataset at once. The manual or filter method gives you more control if you need to see what's being removed before it happens, or if you only care about duplicates in specific columns.

Key Takeaways

  • Excel's Remove Duplicates feature (on the Data tab) deletes entire rows where all values in your selected columns are identical.
  • You must select your data first — the tool only works on what you highlight, not the whole sheet.
  • If you only want to remove duplicates in one column, sorting your data and deleting matching rows manually gives you more control over what stays and what goes.
  • Always make a copy of your spreadsheet before removing duplicates, because the deletion is permanent and cannot be undone with Ctrl+Z after you close the file.

Using the Remove Duplicates feature for entire rows

Open your spreadsheet and select all the data you want to check for duplicates. Click the first cell in the top-left corner of your data, then hold Shift and click the last cell in the bottom-right corner. This selects the entire range. If your data has a header row (column names), include it in your selection — Excel will recognize it and handle it correctly.

Go to the Data tab at the top of the ribbon. Look for the Data Tools group and click Remove Duplicates. A dialog box will open showing all the columns in your selection. By default, all columns are checked. This means Excel will only mark a row as a duplicate if every single column matches another row exactly. Uncheck any columns you want to exclude from the comparison — for example, if you have an ID column that's always unique, uncheck it so rows are compared only on the other columns.

Click OK. Excel will delete the duplicate rows and show you a message saying how many rows were removed. The remaining rows are the ones Excel kept — usually the first occurrence of each unique combination. This action cannot be undone after you close the file, so if you're unsure, save a backup copy first.

Removing duplicates in a single column

If you only care about duplicate values in one column — for example, removing duplicate customer names or product IDs — the Remove Duplicates feature still works, but you need to be careful. Select your entire data range including the column with duplicates. Open the Data tab and click Remove Duplicates. Uncheck every column except the one you want to check for duplicates. Click OK.

This approach deletes entire rows based on duplicates in just that one column, which means you lose data from other columns. If that's not what you want, use the sort-and-delete method instead. Click the column header of the column containing duplicates to select the entire column. Go to the Data tab and click Sort A to Z (or Z to A). This groups identical values together, making duplicates easy to spot and delete manually. You can then select and delete the duplicate rows one by one, or select multiple rows at once by holding Ctrl and clicking each row number on the left side.

Checking for duplicates without deleting them

If you want to see which rows are duplicates before removing anything, use conditional formatting to highlight them. Select your data range. Go to the Home tab and click Conditional Formatting in the Styles group. Choose Highlight Cell Rules and then Duplicate Values. Excel will highlight all duplicate values in your selection with a colored background, usually red or yellow.

This shows you exactly what will be removed without actually deleting anything. You can review the highlighted rows, decide whether the duplicates should really go, and then use Remove Duplicates if you're confident. Conditional formatting stays in place until you remove it, so you can keep it as a visual reference while you work.

Handling headers and special cases

If your data has a header row (the first row with column names like "Name", "Email", "Date"), make sure it's included in your selection when you use Remove Duplicates. Excel automatically detects headers and excludes them from the duplicate check, so your column names won't be deleted. If Excel doesn't recognize your first row as a header, the Remove Duplicates dialog will have a checkbox labeled My data has headers — check it before clicking OK.

If your data has blank cells or cells with spaces that look empty, those can cause problems. A cell with just a space is not the same as a truly empty cell, so Excel might not recognize them as duplicates. Before removing duplicates, use Find & Replace to clean up extra spaces. Press Ctrl+H, type a space in the Find field, leave the Replace field empty, and click Replace All. This removes trailing spaces that can hide duplicates.

Recovering if you delete the wrong data

If you remove duplicates and immediately realize you made a mistake, press Ctrl+Z to undo. This works only in the current session — as long as you haven't closed the file. If you've already closed the file, the deletion is permanent and cannot be recovered through Excel's undo feature.

The safest approach is to always save a copy of your original spreadsheet before removing duplicates. Go to File > Save As and give it a new name like "Original Data Backup". Then work on the original file. If something goes wrong, you still have the backup. Once you're confident the duplicates are gone and the data looks correct, you can delete the backup copy.

Removing duplicates from filtered or sorted data

If your data is already filtered (showing only certain rows), the Remove Duplicates feature will still check all rows in the spreadsheet, not just the visible ones. If you want to remove duplicates only from filtered data, you must first select only the visible cells. Click the first cell of your filtered data, then hold Shift and click the last visible cell. Go to the Data tab and click Remove Duplicates. This time it will work only on what you've selected.

Similarly, if your data is sorted, Remove Duplicates doesn't care about the sort order — it checks the actual values in each row regardless of how they're arranged. Sorting is useful for spotting duplicates visually before you delete them, but the tool itself works the same way whether your data is sorted or not.

Frequently Asked Questions

Does Remove Duplicates delete the first or last occurrence?

Excel keeps the first occurrence of each duplicate and deletes the rest. If you have three rows with the same data, the first one stays and the other two are removed. If you need to keep a different row, sort your data first so the row you want to keep appears first, then run Remove Duplicates.

Can I remove duplicates from just part of my spreadsheet?

Yes. Select only the cells or columns you want to check, then use Remove Duplicates. The tool only works on your selection, not the entire sheet. Make sure your selection includes all the columns you want to compare — if you select only two columns out of five, duplicates in the other three columns won't be detected.

What if two rows are almost identical but not exactly the same?

Remove Duplicates requires an exact match in all selected columns. If one row says "John Smith" and another says "john smith" (different capitalization), Excel treats them as different values and won't remove either one. You may need to clean up your data first using Find & Replace to standardize capitalization or spacing.

Will Remove Duplicates affect my formulas?

If your spreadsheet contains formulas, removing duplicate rows will delete those formulas along with the row data. If other cells reference those formulas, they may show errors afterward. Test on a backup copy first, or manually delete duplicates instead so you can see what's being removed before it happens.

Can I undo Remove Duplicates after I close the file?

No. Once you close the file, the deletion is permanent. Ctrl+Z only works in the current session. Always save a backup copy of your original data before using Remove Duplicates, so you have something to go back to if needed.