How to delete duplicates in excel
Last updated: April 1, 2026
Key Facts
- Excel's Remove Duplicates tool compares all selected columns and deletes rows that are exact matches across all specified columns
- The feature works by analyzing the data in place; you cannot undo after closing the file, so backup your data before using it
- You can specify which columns to check for duplicates; unchecked columns won't be compared, allowing you to remove duplicates based on specific fields
- Advanced Filter with unique records is an alternative method that creates a filtered list without modifying original data
- Formulas like COUNTIF can identify duplicates without deleting them, giving you control and a preview before permanent removal
Using Excel's Remove Duplicates Feature
Excel provides a straightforward built-in tool for removing duplicate entries. Select all your data including headers, then navigate to the Data tab > Remove Duplicates. A dialog box appears showing all columns in your data. Select the columns you want Excel to check for duplicates. If you want to remove rows that are identical across all columns, keep all columns selected. Click OK and Excel immediately removes duplicate rows.
Understanding Duplicate Detection
Excel's Remove Duplicates feature identifies rows as duplicates when all selected columns contain identical values. For example, if you have columns for Name, Email, and Phone, and two rows have the same Name and Email but different Phones, they won't be considered duplicates unless you select all three columns. The first occurrence is kept while subsequent duplicates are deleted.
Backup and Safety Measures
Always backup your data before removing duplicates as the action cannot be easily undone after saving. Save a copy of your file, work on the original, then verify the results. If you're unsure about permanent deletion, use alternative methods that preserve original data. Consider creating a separate sheet with unique records while keeping your original data intact.
Using Advanced Filter for Duplicates
For a non-destructive approach, use Advanced Filter to create a list of unique records. Go to Data > Advanced Filter, choose "Copy to another location," and check "Unique records only." This creates a filtered copy without modifying your original data, allowing you to review results before committing to changes.
Formula-Based Duplicate Detection
Use COUNTIF formulas to identify duplicates while preserving data. Add a helper column with the formula =COUNTIF($A$2:$A2,$A2), which counts how many times each value appears. Values showing "1" are unique, while "2" indicates the first occurrence of a duplicate. This method gives you visibility and control over which duplicates to remove manually.
Handling Large Datasets
For very large datasets, Excel's built-in tools may run slowly. Consider splitting data into smaller sections or using Power Query for more efficient duplicate removal. Power Query allows complex duplicate detection rules and creates a cleaned dataset without modifying original data. This approach is ideal for datasets exceeding 100,000 rows.
Related Questions
Can I undo Remove Duplicates in Excel?
Use Ctrl+Z immediately after removal if the file is still open. However, once you close and save the file, undoing becomes impossible. Always backup before removing duplicates to ensure data recovery.
How do I find duplicates without deleting them?
Use conditional formatting to highlight duplicates or create a helper column with COUNTIF formulas. Advanced Filter with "Unique records only" creates a filtered copy. These methods preserve original data.
What if I only want to remove partial duplicates?
Select only the columns you want to check for duplicates in the Remove Duplicates dialog. Excel will only compare those columns, keeping rows that duplicate in other columns but differ in your selected columns.
Sources
- Microsoft Office Support - Remove Duplicates CC-BY
- Wikipedia - Microsoft Excel CC-BY-SA-4.0