Skip to main content

How to Remove Duplicates in Excel: 5 Best Methods

Learn how to use Excel’s built-in features, formulas, and even Power Query to tackle duplicates, along with best practices and troubleshooting tips for handling complex datasets.
Nov 14, 2024  · 6 min read

Inaccurate data can ruin even the best analysis, and one of the biggest reasons behind inaccurate data is duplicate spreadsheet entries. A single duplicate can skew your results and produce completely wrong conclusions. To avoid all this, you must know how to remove duplicates.

In this article, I’ll share the five best methods to find and remove duplicate data in Microsoft Excel. If you are looking to highlight duplicates without removing them, read my related tutorial, How to Highlight Duplicates in Excel. If you want to familiarize yourself with Excel functions and features before going forward, take our Excel Fundamentals skill track. 

How to Remove Duplicates in Excel

Let’s understand the five most preferred methods for removing duplicate data from tables in Excel.

Advance Your Career with Excel

Gain the skills to maximize Excel—no experience required.

Start Today for Free

Method 1: Remove duplicates with Conditional Formatting

You can use the Conditional Formatting feature to highlight duplicates or unique values and decide whether to remove them. To do so:

  • Select the range of cells you want to check. Then, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.

Conditional Formatting and selecting Duplicate Values option in Excel

Select the Duplicate Values option. Image by Author.

  • A dialog box appears. From the drop-down list, select how you want to highlight the duplicates. Here, I chose Yellow Fill with Dark Yellow Text.

Inside a Duplicate Values dialog box, select the formatting to apply on duplicate values in Excel

Apply the format. Image by Author.

  • Click OK and see the duplicate values highlighted. 

duplicate values highlighted in excel

Duplicate values are highlighted. Image by Author.

However, the Conditional Formatting feature is limited — it can't highlight duplicate values within the Values area of a PivotTable report. In that case, you have to use a different method. 

Method 2: Use the Remove Duplicates feature

Another quick way to remove duplicates is to use the Remove Duplicates feature, a built-in Excel tool that cleans up your data by removing duplicates permanently. To use this method:

  • Select the range of cells or click on a cell, and Excel will automatically identify the range of cells.

Click on a cell and excel will automatically detect the range of cell

Identifying the range of cells. Image by Author.

  • Next, go to the Data tab  > Data Tools and select Remove Duplicates.

Under the data tab finding the Remove Duplicate feature

Remove Duplicates feature. Image by Author.

  • A dialog box will appear. Here, I select the columns that should be checked for duplicates. If your data includes column headers, check the My data has headers box and click OK.

A dialog box for the Remove Duplicates feature in Excel.

Dialog box for the Remove Duplicates feature. Image by Author.

  • Excel will display a message showing the number of duplicates removed and the number of unique entries remaining.

Message box displaying the summary of numbers removed using Remove Duplicates feature in Excel

Message box. Image by Author.

  • Now you can see all the duplicate rows are removed.

All the duplicates removed using Remove Duplicates feature in Excel

Removed all the duplicate rows. Image by Author.

Method 3: Remove duplicate values using the Advanced Filter option

You can also use the Advanced Filter function in Excel to extract unique values by filtering out duplicates, keeping the original data while showing unique entries. Here's how you can use it:

  • Select a range of cells or a single cell and Advanced Filter will automatically identify the range. Next, go to the Data tab > Sort & Filter and click Advanced.

Under Data tab select Advanced filter in Excel.

Advanced feature option. Image by Author.

  • A dialog box will appear. To copy unique values to a different location, select Copy to another location. In the Copy to field, specify where to display the unique values. Then, select the Unique records only box and click OK.

A dialog box for the Advanced Filter.

Dialog box for the Advanced Filter. Image by Author.

  • Now, all the unique values are copied to our specified range.

Filter the unique values

Filter the unique values using Advanced Filter. Image by Author.

Method 4: Remove duplicates with formulas

Now that you know 3 built-in features for removing duplicates, let's understand some custom functions you can create to achieve the same result. For example, I have a dataset with Name, Subject, and Grade columns.

Dataset of students records in Excel

Dataset of students. Image by Author.

To create a formula for filtering out duplicate values:

First, I combine all the columns (A,B,C) in one cell. There are two methods to do this: the CONCATENATE() function or the & operator. Choose whatever you like and the results will be the same. To use & operator, type the following formula: 

=A2&B2&C2

 To use CONCATENATE() function, type the following formula: 

=CONCATENATE(A2,B2,C2)

Concatenate the columns

Concatenate the columns. Image by Author.

In the next column, use COUNTIF() to calculate the number of times each value appears in column D:

=COUNTIF(D2:D18,D2)

Here, count 1 means the value is unique, and count  2 or more indicates a duplicate.

Use <code624

Apply COUNTIF() to count the occurrences. Image by Author.

Next, go to Data tab > Sort & Filter > select Filter to apply a filter to the count column. 

Applying Filter to the columns in Excel.

Apply Filter. Image by Author.

Then, open the drop-down menu, select 1 to keep unique values and eliminate duplicates, and hit OK.

Select 1 from the options to keep the unique values in Excel.

Keep the unique values. Image by Author.

Now you can see all the duplicate values have been removed. This method is more complex but dynamically updates as your data changes, so it’s perfect for those who want ongoing duplicate management.

removed all the duplicate values using Filter feature in Excel

Duplicate values removed using the Filter feature. Image by Author.

Method 5: Remove duplicates using Power Query

You can also use Power Query to clean your data and remove duplicates. Here’s how:

Select a cell or range of cells. Go to the Data tab > Get & Transform Data section and click From Table/Range. A dialog box will appear to create a power query table, and the range of values will be automatically selected. Then hit OK.

opening the excel data in power query editor

Creating a table. Image by Author.

Now, the Power Query editor window will appear. From there, choose the Remove Duplicates option to select specific columns or the entire table. For the whole table, click on the top left corner button. For a specific column, right-click on the particular header or use CTRL to select more than one column. Once done, click the Close & Load option at the top left corner to load the cleaned data back into Excel.

removing duplicate data using  power query in excel

Removing duplicate data. Image by Author.

You can see the modified dataset appears back in Excel. To understand this further, you can select another column, like Subject, from this example, and repeat the steps for practice. This way, only those rows where the student name is duplicated will be removed.

The data is loaded from power query to an Excel sheet

Data loaded in an Excel sheet. Image by Author.

This method is perfect if you work with large datasets or need to automate the duplicate removal process for future data refreshes. 

Methods to Remove Duplicates in Excel: Which One’s The Best?

We've seen five different methods to remove duplicates in Excel. Now, I want to help you choose which one is best, but before I do, let's first talk quickly about the two types of duplicate data. 

Different types of duplicate data

So far, to be clear, I've focused on how to remove duplicate values in a column, and every method I have shown so far works if this is your issue. However, to be clear, in Excel, duplicates can appear in two forms — duplicate values and duplicate rows:

  • Duplicate values are repeated entries in a single column. For example, if I have a column of names and Minny appears multiple times, those are duplicate values.
  • Duplicate rows occur when entire rows have identical data across all columns. For example, my table has Name, Age, and City columns. If two or more rows have the same fields, they are duplicate rows.

Summary table

Here's a summary table that shows the specific advantages of each method. Here, I've also added a column to show if the method can be extended to remove duplicate rows as well. Basically, if you want to remove an entire duplicate row, try Conditional Formatting, Advanced Filter, Formulas, or Power Query, but leave the Remove Duplicates Features for simple use cases.

Method Key Advantages Best for Removing
Remove Duplicates Feature Quick and easy for removing duplicates Duplicate rows
Conditional Formatting Visual identification of duplicates before removal Duplicate values or duplicate rows
Advanced Filter Preserves original data while filtering unique entries Duplicate values or duplicate rows
Formulas Dynamic control over duplicate criteria Duplicate values or duplicate rows
Power Query Automates duplicate removal for future updates Duplicate values or duplicate rows

Best Practices for Duplicate Removal

Here are a couple of best practices I recommend when starting any data cleanup project:

  • Keep Backup: Always maintain an untouched backup of your raw data before starting any cleanup. You can use the original version as your reference point whenever needed.
  • Define your Duplicates: Establish clear criteria for what constitutes a duplicate in your specific context. Sometimes, it's not as simple as exact matches across all fields.
  • Standardize First: Clean and standardize your data before attempting duplicate detection — normalize case, trim spaces, fix date formats, and handle special characters.
  • Start Simple, Then Refine: Begin with exact matches before moving to more complex matching. This approach will help you incrementally understand your data quality.
  • Validate Your Results: Spot-check your results when using automated tools to catch systematic errors.

Troubleshoot Common Excel Issues

Let’s look at the most common problems that you may come across when removing duplicates.

Duplicates not removed

Sometimes, we copy data from websites or external sources — this data usually contains hidden characters or spaces that prevent Excel from identifying duplicate entries. To solve this issue, you can use the TRIM() and CLEAN() functions. The TRIM() function will remove excessive spaces between words, and the CLEAN() function will remove non-printable characters.

=CLEAN(TRIM(A1))

Data with subtotals or outlines

If your spreadsheet contains subtotals or outlines, they can interfere with the duplicate removal process. Excel treats these summary rows as unique entries, which can lead to incomplete duplicate removal. To avoid this, remove all subtotals and outlines from your data before removing duplicates. 

Here’s how you can do so:

  • To remove outlines: Go to the Data tab, find the Outline group, and click Clear Outline.
  • To remove subtotals: Go to the Data tab, click Subtotal, then click Remove All.

After removing outlines and subtotals, you can proceed with duplicate removal as usual.

Case sensitivity

Excel considers uppercase and lowercase text as different values when checking for duplicates. For example, Product and PRODUCT would be treated as different entries. To avoid this, use the UPPER(), LOWER() or PROPER() functions to standardize the text case across all your data before starting the removal process.

  • =UPPER() convert text to uppercase. 

  • =LOWER() converts text to lowercase. 

  • =PROPER() capitalizes the first letter of each word.

Final Thoughts

Cleaning up duplicates in Excel may seem like a small task, but it can make a big difference in your work. I've covered five ways to do this, from quick built-in features to more advanced techniques. You should try different methods until you find an approach that fits smoothly into your workflow and keeps your data accurate. 

If you want to strengthen your Excel skills further, check out our Data Analysis in Excel course and Data Analysis with Excel Power Tools skills track.

Learn Excel Fundamentals

Gain skills to use Excel effectively—no experience required.

Photo of Laiba Siddiqui
Author
Laiba Siddiqui
LinkedIn
Twitter

I'm a content strategist who loves simplifying complex topics. I’ve helped companies like Splunk, Hackernoon, and Tiiny Host create engaging and informative content for their audiences.

Common Questions About Removing Excel Duplicates

Can I create alerts for future duplicates in Excel?

While Excel does not have built-in alerts for duplicates, you can use conditional formatting to highlight duplicates as soon as they are entered.

Is there an Excel formula to remove duplicates?

Yes, you can use the UNIQUE() function in Excel 365 or similar formulas to display unique values in real time as data changes.

How do I remove duplicates but keep the first instance in Excel?

Sort your data by the date modified column (descending) before removing duplicates. This way, Excel will keep the first (most recent) occurrence.

Topics

Learn Excel with DataCamp

course

Data Preparation in Excel

3 hr
34.7K
Understand how to prepare Excel data through logical functions, nested formulas, lookup functions, and PivotTables.
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

tutorial

How to Highlight Duplicates in Excel

Explore how you can identify duplicate entries in Excel using Conditional Formatting, the COUNTIF() formula, and Power Query. Learn best practices and troubleshoot issues.
Laiba Siddiqui's photo

Laiba Siddiqui

6 min

tutorial

How to Clean Data in Excel: A Beginner's Guide

Learn essential data cleaning techniques in Excel, including removing duplicates, handling missing values, and maintaining consistent formatting.
Laiba Siddiqui's photo

Laiba Siddiqui

15 min

tutorial

SQL Remove Duplicates: Comprehensive Methods and Best Practices

Explore the different methods for filtering out and permanently removing duplicate rows using SQL. Learn the practical applications of how to remove duplicates in SQL Server, MySQL, and PostgreSQL.
Allan Ouko's photo

Allan Ouko

8 min

tutorial

How to Compare Two Columns in Excel: A Step-by-Step Guide

Learn how to compare two columns in Excel for matches and for duplicates using methods like the equals operator, IF() function, EXACT(), VLOOKUP(), and more.
Laiba Siddiqui's photo

Laiba Siddiqui

9 min

tutorial

How to Separate Names in Excel: 3 Easy Methods

Discover how to separate names in Excel with features like Text to Columns, Flash Fill, and custom-built formulas. Make your spreadsheets cleaner and easier to work with.
Laiba Siddiqui's photo

Laiba Siddiqui

7 min

tutorial

How to Create Data Models in Excel: A Comprehensive Guide

We create data models by formatting data, creating relationships, using Power Query, and leveraging Power Pivot for seamless data integration and analysis.
Vikash Singh's photo

Vikash Singh

13 min

See MoreSee More