Find and remove duplicates
Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel Starter 2010 More…Less
Sometimes duplicate data is useful, sometimes it just makes it harder to understand your data. Use conditional formatting to find and highlight duplicate data. That way you can review the duplicates and decide if you want to remove them.
-
Select the cells you want to check for duplicates.
Note: Excel can’t highlight duplicates in the Values area of a PivotTable report.
-
Click Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
-
In the box next to values with, pick the formatting you want to apply to the duplicate values, and then click OK.
Remove duplicate values
When you use the Remove Duplicates feature, the duplicate data will be permanently deleted. Before you delete the duplicates, it’s a good idea to copy the original data to another worksheet so you don’t accidentally lose any information.
-
Select the range of cells that has duplicate values you want to remove.
-
Click Data > Remove Duplicates, and then Under Columns, check or uncheck the columns where you want to remove the duplicates.
For example, in this worksheet, the January column has price information I want to keep.
So, I unchecked January in the Remove Duplicates box.
-
Click OK.
Note: The counts of duplicate and unique values given after removal may include empty cells, spaces, etc.
Need more help?
Need more help?
Want more options?
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
This example teaches you how to remove duplicates in Excel.
1. Click any single cell inside the data set.
2. On the Data tab, in the Data Tools group, click Remove Duplicates.
The following dialog box appears.
3. Leave all check boxes checked and click OK.
Result. Excel removes all identical rows (blue) except for the first identical row found (yellow).
To remove rows with the same values in certain columns, execute the following steps.
4. For example, remove rows with the same Last Name and Country.
5. Check Last Name and Country and click OK.
Result. Excel removes all rows with the same Last Name and Country (blue) except for the first instances found (yellow).
Let’s take a look at one more cool Excel feature that removes duplicates. You can use the Advanced Filter to extract unique rows (or unique values in a column).
6. On the Data tab, in the Sort & Filter group, click Advanced.
The Advanced Filter dialog box appears.
7. Click Copy to another location.
8. Click in the List range box and select the range A1:A17 (see images below).
9. Click in the Copy to box and select cell F1 (see images below).
10. Check Unique records only.
11. Click OK.
Result. Excel removes all duplicate last names and sends the result to column F.
Note: at step 8, instead of selecting the range A1:A17, select the range A1:D17 to extract unique rows.
12. Finally, you can use conditional formatting in Excel to highlight duplicate values.
13. Or use conditional formatting in Excel to highlight duplicate rows.
Tip: visit our page about finding duplicates to learn more about these tricks.
This wikiHow teaches you how to remove duplicate entries from a Microsoft Excel spreadsheet.
-
1
Double-click your Excel document. This will open the spreadsheet in Excel.
- You can also open an existing document from the «Recent» section of the Open tab.
-
2
Select your data group. To do so, click the top entry, hold down ⇧ Shift, and click the bottom entry.
- If you’re selecting multiple columns, click the top-left entry, then click the bottom-right entry while holding down ⇧ Shift.
-
3
Click the Data tab. It’s a tab on the left side of the green ribbon at the top of the Excel window.
-
4
Click Remove Duplicates. This option is the «Data Tools» section of the Data toolbar near the top of the Excel window. A pop-up window will appear with the option of selecting or de-selecting columns.
-
5
Make sure each column you wish to edit is selected. You’ll see several column names (e.g., «Column A», «Column B») next to checkboxes; clicking a checkbox will de-select the column in question.
- By default, all columns next to the one you select will be listed and checked here.
- You can click Select All to select all of the columns listed.
-
6
Click OK. Doing so will remove any duplicates from your Excel spreadsheet selection.
- If no duplicates are reported when you know there are duplicates, try selecting one column at a time.
-
1
Double-click your Excel document. This will open the spreadsheet in Excel, allowing you to check it for cells containing duplicate values by using the Conditional Formatting feature. If you want to look for duplicates but don’t want to delete them by default, this is a good way of doing so.
- You can also open an existing document from the «Recent» section of the Open tab.
-
2
Click the top-left cell in your data group. Doing so will select it.
- Exclude headers (e.g., «Date», «Time», etc.) from your selection.
- If you’re just selecting one row, click the left-most entry.
- If you’re just selecting one column, click the top-most entry.
-
3
Hold down ⇧ Shift and click the bottom-right cell. This will select any data between the top-left corner and the bottom-right corner of the data group.
- If you’re selecting one row, just click the right-most cell with data in it.
- If you’re selecting one column, just click the bottom-most entry with data in it.
-
4
Click Conditional Formatting. It’s in the «Styles» section of the Home tab. Doing so will prompt a drop-down menu.
- You may first need to click Home near the top of the Excel window to view this option.
-
5
Select Highlight Cells Rules. You’ll see a window pop out from here.
-
6
Click Duplicate Values. It’s at the bottom of the pop-out menu. Clicking this option will select all duplicate values in your selected range.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
About this article
Article SummaryX
1. Open the Excel document.
2. Select your data group.
3. Click Data.
4. Click Remove Duplicates.
5. Click OK.
Did this summary help you?
Thanks to all authors for creating a page that has been read 420,580 times.
Reader Success Stories
-
«Simple click that save me tons of time sorting and filtering.»
Is this article up to date?
Duplicate values in your data can be a big problem! It can lead to substantial errors and over estimate your results.
But finding and removing them from your data is actually quite easy in Excel.
In this tutorial, we are going to look at 7 different methods to locate and remove duplicate values from your data.
Video Tutorial
What Is A Duplicate Value?
Duplicate values happen when the same value or set of values appear in your data.
For a given set of data you can define duplicates in many different ways.
In the above example, there is a simple set of data with 3 columns for the Make, Model and Year for a list of cars.
- The first image highlights all the duplicates based only on the Make of the car.
- The second image highlights all the duplicates based on the Make and Model of the car. This results in one less duplicate.
- The second image highlights all the duplicates based on all columns in the table. This results in even less values being considered duplicates.
The results from duplicates based on a single column vs the entire table can be very different. You should always be aware which version you want and what Excel is doing.
Find And Remove Duplicate Values With The Remove Duplicates Command
Removing duplicate values in data is a very common task. It’s so common, there’s a dedicated command to do it in the ribbon.
Select a cell inside the data which you want to remove duplicates from and go to the Data tab and click on the Remove Duplicates command.
Excel will then select the entire set of data and open up the Remove Duplicates window.
- You then need to tell Excel if the data contains column headers in the first row. If this is checked, then the first row of data will be excluded when finding and removing duplicate values.
- You can then select which columns to use to determine duplicates. There are also handy Select All and Unselect All buttons above you can use if you’ve got a long list of columns in your data.
When you press OK, Excel will then remove all the duplicate values it finds and give you a summary count of how many values were removed and how many values remain.
This command will alter your data so it’s best to perform the command on a copy of your data to retain the original data intact.
Find And Remove Duplicate Values With Advanced Filters
There is also another way to get rid of any duplicate values in your data from the ribbon. This is possible from the advanced filters.
Select a cell inside the data and go to the Data tab and click on the Advanced filter command.
This will open up the Advanced Filter window.
- You can choose to either to Filter the list in place or Copy to another location. Filtering the list in place will hide rows containing any duplicates while copying to another location will create a copy of the data.
- Excel will guess the range of data, but you can adjust it in the List range. The Criteria range can be left blank and the Copy to field will need to be filled if the Copy to another location option was chosen.
- Check the box for Unique records only.
Press OK and you will eliminate the duplicate values.
Advanced filters can be a handy option for getting rid of your duplicate values and creating a copy of your data at the same time. But advanced filters will only be able to perform this on the entire table.
Find And Remove Duplicate Values With A Pivot Table
Pivot tables are just for analyzing your data, right?
You can actually use them to remove duplicate data as well!
You won’t actually be removing duplicate values from your data with this method, you will be using a pivot table to display only the unique values from the data set.
First, create a pivot table based on your data. Select a cell inside your data or the entire range of data ➜ go to the Insert tab ➜ select PivotTable ➜ press OK in the Create PivotTable dialog box.
With the new blank pivot table add all fields into the Rows area of the pivot table.
You will then need to change the layout of the resulting pivot table so it’s in a tabular format. With the pivot table selected, go to the Design tab and select Report Layout. There are two options you will need to change here.
- Select the Show in Tabular Form option.
- Select the Repeat All Item Labels option.
You will also need to remove any subtotals from the pivot table. Go to the Design tab ➜ select Subtotals ➜ select Do Not Show Subtotals.
You now have a pivot table that mimics a tabular set of data!
Pivot tables only list unique values for items in the Rows area, so this pivot table will automatically remove any duplicates in your data.
Find And Remove Duplicate Values With Power Query
Power Query is all about data transformation, so you can be sure it has the ability to find and remove duplicate values.
Select the table of values which you want to remove duplicates from ➜ go to the Data tab ➜ choose a From Table/Range query.
Remove Duplicates Based On One Or More Columns
With Power Query, you can remove duplicates based on one or more columns in the table.
You need to select which columns to remove duplicates based on. You can hold Ctrl to select multiple columns.
Right click on the selected column heading and choose Remove Duplicates from the menu.
You can also access this command from the Home tab ➜ Remove Rows ➜ Remove Duplicates.
= Table.Distinct(#"Previous Step", {"Make", "Model"})
If you look at the formula that’s created, it is using the Table.Distinct function with the second parameter referencing which columns to use.
Remove Duplicates Based On The Entire Table
To remove duplicates based on the entire table, you could select all the columns in the table then remove duplicates. But there is a faster method that doesn’t require selecting all the columns.
There is a button in the top left corner of the data preview with a selection of commands that can be applied to the entire table.
Click on the table button in the top left corner ➜ then choose Remove Duplicates.
= Table.Distinct(#"Previous Step")
If you look at the formula that’s created, it uses the same Table.Distinct function with no second parameter. Without the second parameter, the function will act on the whole table.
Keep Duplicates Based On A Single Column Or On The Entire Table
In Power Query, there are also commands for keeping duplicates for selected columns or for the entire table.
Follow the same steps as removing duplicates, but use the Keep Rows ➜ Keep Duplicates command instead. This will show you all the data that has a duplicate value.
Find And Remove Duplicate Values Using A Formula
You can use a formula to help you find duplicate values in your data.
First you will need to add a helper column that combines the data from any columns which you want to base your duplicate definition on.
= [@Make] & [@Model] & [@Year]
The above formula will concatenate all three columns into a single column. It uses the ampersand operator to join each column.
= TEXTJOIN("", FALSE , CarList[@[Make]:[Year]])
If you have a long list of columns to combine, you can use the above formula instead. This way you can simply reference all the columns as a single range.
You will then need to add another column to count the duplicate values. This will be used later to filter out rows of data that appear more than once.
= COUNTIFS($E$3:E3, E3)
Copy the above formula down the column and it will count the number of times the current value appears in the list of values above.
If the count is 1 then it’s the first time the value is appearing in the data and you will keep this in your set of unique values. If the count is 2 or more then the value has already appeared in the data and it is a duplicate value which can be removed.
Add filters to your data list.
- Go to the Data tab and select the Filter command.
- Use the keyboard shortcut Ctrl + Shift + L.
Now you can filter on the Count column. Filtering on 1 will produce all the unique values and remove any duplicates.
You can then select the visible cells from the resulting filter to copy and paste elsewhere. Use the keyboard shortcut Alt + ; to select only the visible cells.
Find And Remove Duplicate Values With Conditional Formatting
With conditional formatting, there’s a way to highlight duplicate values in your data.
Just like the formula method, you need to add a helper column that combines the data from columns. The conditional formatting doesn’t work with data across rows, so you’ll need this combined column if you want to detect duplicates based on more than one column.
Then you need to select the column of combined data.
To create the conditional formatting, go to the Home tab ➜ select Conditional Formatting ➜ Highlight Cells Rules ➜ Duplicate Values.
This will open up the conditional formatting Duplicate Values window.
- You can select to either highlight Duplicate or Unique values.
- You can also choose from a selection of predefined cell formats to highlight the values or create your own custom format.
Warning: The previous methods to find and remove duplicates considers the first occurrence of a value as a duplicate and will leave it intact. However, this method will highlight the first occurrence and will not make any distinction.
With the values highlighted, you can now filter on either the duplicate or unique values with the filter by color option. Make sure to add filters to your data. Go to the Data tab and select the Filter command or use the keyboard shortcut Ctrl + Shift + L.
- Click on the filter toggle.
- Select Filter by Color in the menu.
- Filter on the color used in the conditional formatting to select duplicate values or filter on No Fill to select unique values.
You can then select just the visible cells with the keyboard shortcut Alt + ;.
Find And Remove Duplicate Values Using VBA
There is a built in command in VBA for removing duplicates within list objects.
Sub RemoveDuplicates()
Dim DuplicateValues As Range
Set DuplicateValues = ActiveSheet.ListObjects("CarList").Range
DuplicateValues.RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes
End Sub
The above procedure will remove duplicates from an Excel table named CarList.
Columns:=Array(1, 2, 3)
The above part of the procedure will set which columns to base duplicate detection on. In this case it will be on the entire table since all three columns are listed.
Header:=xlYes
The above part of the procedure tells Excel the first row in our list contains column headings.
You will want to create a copy of your data before running this VBA code, as it can’t be undone after the code runs.
Conclusions
Duplicate values in your data can be a big obstacle to a clean data set.
Thankfully, there are many options in Excel to easily remove those pesky duplicate values.
So, what’s your go to method to remove duplicates?
About the Author
John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.
Excel spreadsheets continue to represent a key tool for data storage and visualization. Functionalities such as Find & Replace or Sort help users speed up repetitive tasks that would otherwise be time-consuming and inefficient. Just like working on a spreadsheet with blank rows or cells that interfere with the correct application of rules and formulae, duplicate data can cause similar issues.
In this post, you will learn different ways to find duplicate values to either highlight this information or delete as many duplicates as needed. From more basic highlighting features to more advanced filtering options, you’ll learn how to work with the full potential of the desktop version of Excel.
If you want to avoid duplicate data entry in Google Sheets, you can do that easily using Layer. Layer is a free add-on that allows you to share sheets or ranges of your main spreadsheet with different people. On top of that, you get to monitor and approve edits and changes made to the shared files before they’re merged back into your master file, giving you more control over your data.
Install the Layer Google Sheets Add-On today and Get Free Access to all the paid features, so you can start managing, automating, and scaling your processes on top of Google Sheets!
How to find and remove duplicate rows in Excel?
The various methods shown in this article will first find the duplicate values to be removed and then show how to delete them. This two-step process is crucial, especially considering that you may not want to delete the duplicates automatically and keep only the unique value. Let’s look at the first method to remove all duplicates.
How to Check for Duplicates in Excel?
How to remove duplicates using the Remove Duplicates feature?
What is the shortcut to removing duplicates in Excel? The shortcut is actually a built-in command available in the ribbon, which you can use in the following way.
- 1. Open your Excel spreadsheet and select any range in your spreadsheet which you want to delete duplicate rows from.
How to Find and Remove Duplicates in Excel — Find duplicate rows
- 2. Go to Data > Remove duplicates.
How to Find and Remove Duplicates in Excel — Remove duplicates
If you haven’t selected all data in your spreadsheet, Excel will give you the option of expanding the search to the entire document, which is recommended. Click “OK”.
- 3. In case your data selection has headers, tick the column boxes that contain them so as not to be counted in the duplicate search. All columns in my example contain headers, so I’ll leave all boxes ticked. Click “OK”.
How to Find and Remove Duplicates in Excel — Remove headers from duplicate search
- 4. Excel prompts you with a dialog box informing you about the exact number of duplicate values it found and removed, as well as the number of unique values remaining in your spreadsheet.
How to Find and Remove Duplicates in Excel — Duplicate values found
How to Combine Multiple Excel Columns Into One?
There are many ways to combine multiple columns into a single column in Excel. Here’s how to do it without losing any data
READ MORE
How to delete duplicates in Excel but keep one?
Although the previous method is helpful at targeting all duplicates, this means that the unique data will also be permanently deleted. To avoid this, you may want to explore the following methods.
Here’s how to delete duplicates in Excel but keep one; we strongly recommend that you always keep a copy spreadsheet in case you want to go back to the original dataset.
How to remove duplicates using the Advanced Filter option?
This is a straightforward way to get rid of any duplicate content without deleting them entirely; instead, the Advanced filter option hides your duplicates from your dataset.
- 1. Select a cell in your dataset and go to Data > Advanced filter to the far right.
How to Find and Remove Duplicates in Excel — Advanced filter
- 2. Choose to “Filter the list, in-place” or “Copy to another location”. The first option will hide any row containing duplicates, while the second will make a copy of the data.
How to Find and Remove Duplicates in Excel — Filter list
Leave the “List range” field empty, if you want Excel to list it automatically. You can also leave the “Criteria range” empty. The only mandatory field to fill out is the “Copy to” if you selected the “Copy to another location” option.
- 3. Tick the “Unique records only” box to keep the unique values, and then “OK” to remove all duplicates.
How to Find and Remove Duplicates in Excel — How to keep unique values
Advanced filters are an excellent way to remove duplicate values while keeping a copy of the original data. Don’t forget that the Advanced filter option only applies to the entire table.
How to remove duplicates using Excel formulae?
Although you can combine various formulae to remove duplicates in Excel, in 2018, Microsoft integrated the UNIQUE formula to make this process much easier. First, let’s explore the syntax of the UNIQUE formula:
=UNIQUE (array, [by_col], [exactly_once])
- array refers to the range of cells we will extract unique values from and represents the only required argument.
- [by_col] is an optional parameter determining the search for unique values by rows or columns.
- [exactly_once] is the other optional parameter and sets the behavior for values that appear more than once. If you want the formula to return items that appear exactly once, then write “TRUE”; however, if you want it to return every distinct item, then write “FALSE”.
Let’s now apply the =UNIQUE formula to our dataset.
- 1. Enter the formula next to the set of data. You can either leave one column in between or place it directly next to the last data column. Like in most Excel formulae, as soon as you type at the beginning of the formula, the rest will prompt automatically. Select the range you want to apply the formula to.
How to Find and Remove Duplicates in Excel — UNIQUE formula
- 2. You can leave the second parameter [by_col] by simply including the comma before and after its place. Let’s first see what happens when we include “TRUE” for the [exactly_once] parameter.
How to Find and Remove Duplicates in Excel — UNIQUE function
- 3. As soon as you press the Return key, Excel removes all duplicates. In this example, it has removed rows 5 and 6.
How to Find and Remove Duplicates in Excel — TRUE UNIQUE formula
Let’s see how by including “FALSE” as the last parameter, Excel will keep the unique value.
- 1. Follow the previous steps, and now wrote “FALSE”, to return every distinct value.
How to Find and Remove Duplicates in Excel — FALSE UNIQUE formula
- 2. Now, the UNIQUE formula has returned row 5 and only deleted the duplicate value in row 6.
How to Find and Remove Duplicates in Excel — FALSE UNIQUE formula return
How to remove duplicates using conditional formatting?
Conditional formatting is an Excel feature that helps users filter, sort, and organize data according to built-in rules or custom ones created by the user. The most common feature is the “Highlight Cell Rules”, which allows you to format cell values according to color, font, and various other format styles. Although this method won’t directly remove duplicates, it will make them extremely clear to identify.
- 1. Select the range of cells you want to apply the conditional formatting rule to. Then go to Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values.
How to Find and Remove Duplicates in Excel — Conditional formatting
- 2. Set the “Style” to “Classic” and then “Format only unique or duplicate values”. Don’t forget to leave the drop-down menu to “duplicate”. Finally, choose the formatting style using the “Format with” drop-down menu. Click “OK”.
How to Find and Remove Duplicates in Excel — Conditional formatting remove duplicates
- 3. You can see how Excel highlights all duplicate values, including the cells. This means that you will need to make sure to only remove rows unless you are actually interested in removing all duplicates.
How to Find and Remove Duplicates in Excel — Highlight duplicates conditional formatting]
In case you want to highlight rows, you can combine all row values in one cell using the =CONCAT formula; if you would like to learn more about this function, read this article on the Microsoft support page.
How to remove duplicates based on one or more columns in Excel?
As a more advanced use of Excel, you can remove duplicates based on one or more columns using Power Query. This feature allows you to select the columns you would like to remove the duplicates from. Let’s explore how to use Power Query to remove duplicates based on one or more columns.
- 1. Go to Data > Get Data (Power Query).
How to Find and Remove Duplicates in Excel — Power Query
- 2. Choose “Excel workbook” as your data source.
How to Find and Remove Duplicates in Excel — Power Query data source
- 3. Browse through your files and select the spreadsheet you want to apply the Power Query function to. Click “Next”.
How to Find and Remove Duplicates in Excel — Power Query load data
- 4. Tick the checkbox next to the worksheet containing your data (located in the left-side menu). Then, click “Load” in the bottom right-hand corner.
How to Find and Remove Duplicates in Excel — Power Query load data
- 5. As you can see, the dataset has been transformed into a table.
How to Find and Remove Duplicates in Excel — Power Query table
- 6. Select the columns to apply the Power Query to by pressing Ctrl/Cmd + click on the columns.
How to Find and Remove Duplicates in Excel — Power Query table
- 7. To delete duplicates, simply click on “Remove Duplicates” in the “Data” tab. Then click “OK” in the pop-up dialog box.
How to Find and Remove Duplicates in Excel — Remove Duplicates
- 8. Excel will inform you about the number of duplicates removed and how many unique values remain.
How to Find and Remove Duplicates in Excel — Final Alert message
Don’t worry about removing all duplicates, since the dataset you worked on is a copy created by the Power Query function. However, if you want to keep unique values, follow the steps outlined in the sections on the Advanced Filter option or =UNIQUE formula in Excel.
Want to Boost Your Team’s Productivity and Efficiency?
Transform the way your team collaborates with Confluence, a remote-friendly workspace designed to bring knowledge and collaboration together. Say goodbye to scattered information and disjointed communication, and embrace a platform that empowers your team to accomplish more, together.
Key Features and Benefits:
- Centralized Knowledge: Access your team’s collective wisdom with ease.
- Collaborative Workspace: Foster engagement with flexible project tools.
- Seamless Communication: Connect your entire organization effortlessly.
- Preserve Ideas: Capture insights without losing them in chats or notifications.
- Comprehensive Platform: Manage all content in one organized location.
- Open Teamwork: Empower employees to contribute, share, and grow.
- Superior Integrations: Sync with tools like Slack, Jira, Trello, and more.
Limited-Time Offer: Sign up for Confluence today and claim your forever-free plan, revolutionizing your team’s collaboration experience.
Conclusion
As we have seen, there are many ways to identify and eliminate duplicates in your data, depending on your needs. Not only can you now successfully organize your data correctly, but removing duplicates makes it easier to identify key patterns and create accurate reports, particularly when working with larger datasets.
How to Remove Duplicates in Excel (and Find Them)
In an Excel spreadsheet, you’d often have to collate data from multiple sources. Sometimes from external sources (like webpages) too 🖨
And this might result in duplicates in your Excel sheet. So how can you remove them? By scanning your worksheet for dupes manually?
Nah! That’s not going to work if you have a large dataset. Let’s think of a smarter solution 🧠
To find and remove duplicate values in Excel, you can use the Remove Duplicate tool of Excel (and some other easy ways too). To learn how, dive straight into the guide below.
Practice along with the guide by downloading our sample workbook here 📩
How to remove duplicates in excel
We will look into multiple methods of removing duplicates in Excel. Which one’s the best? I leave that to you 😅
So, here’s the list of names that have many instances of duplication.
We need to remove the duplicate values from this list.
Here are different methods that can help you do this✂
Advanced Filter
To remove duplicates values from your data using the advanced filters:
- Select the data that needs to be filtered.
- Go to the Data Tab > Advanced Filters.
This opens up the Advanced Filter dialog box as follows 👀
The list range is already selected (that’s because we selected the data to be filtered before launching the advanced filter) 👌
Pro Tip!
Under the box Action:
- Select Filter the list, in place if you want the original dataset to be de-duped.
- Select copy to another location if you don’t want to disturb the original data. This way Excel will ask you for a location (a cell range basically) where you want to create a copy of the source data. Duplicates will then be deleted from this copied set of data and your original data will remain the same.
- Check the option for Unique Records only. This tells Excel to delete any dupes from the dataset.
- Click Okay.
Here comes the data which no longer has duplicates 🤩
Note that we had selected the option to Filter in place so our original dataset has changed.
Remove Duplicates
Do you know Excel has an in-built feature for removing duplicates? We will explore that now 🔎
So with the same list of names, here we go:
- Select the column header for the column that contains the duplicate values (List of Names in our example).
- Go to the Data Tab > Remove Duplicates.
- Select the column from where the duplicates are to be removed. Note that it is already selected in our case.
- Check the box for “My data has headers” as highlighted below.
- Click Okay.
Excel brings you a dialog box that tells how many duplicate values have been found and removed. And how many unique values are retained. This way you can remove duplicates from each column of your dataset 🚀
Here is the deduped list. Excel has found and removed all instances of duplication 💪
UNIQUE function
Another way how you can extract unique (or other than duplicate values) from a dataset is by using the UNIQUE function.
The UNIQUE function extracts a list of unique values from a given set of values 📝
Must know that the UNIQUE function is a dynamic array function. It returns an array of unique values 📌
And as it is a dynamic array function, it is only available in the dynamic versions of Excel. Starting from Excel 2021 to Microsoft 365 only. The older (non-dynamic versions) of Excel do not support dynamic array functions.
So to extract a list of unique names from our dataset:
- Begin writing the UNIQUE function as follows ✍
= UNIQUE
- Specify the range that needs to be filtered.
= UNIQUE (A2:A8)
We want to remove dupes from the list of names i.e. Cell A2 to Cell A8. So we are creating a reference to these cells.
- Hit Enter, and there are your filtered values.
Pro Tip!
Instead of an array of unique values, did the UNIQUE function return the #SPILL error 🥴
That’s because your spill range is not empty (some cells might already have values). The spill range is the cell range (to the bottom or right of the active cell) where the UNIQUE function will populate the array of unique values.
How to find duplicates in excel
You’d enjoy the process of finding duplicates in Excel. Make sure you’re there with us till the end of it 🚴♀️
Continuing with the same list of names from our previous example.
This time we only need to find out the duplicate values from this list, so here we go.
- Select the data (from where you want to find the duplicates).
- Go to the Home Tab > Conditional Formatting.
- From the drop-down menu that appears, select Highlight Cell Rules > Duplicate values 🎨
This way the conditional formatting tool of Excel will highlight duplicates from the selected dataset.
Like in the image below.
We have all the duplicate data highlighted from our dataset above.
However, all the values are still mixed. Do you want to separate the duplicate values?
Do it through the steps below 👇
- Select the header for the subject column (List of Names in our example).
- Go to the Data tab > Filter.
Once the filters are applied, you’d see the filter icon (drop-down menu icon) inside the selected column header.
- Click on that drop-down menu icon 🔽
- From the context menu that opens up, select Sort by Color > Red.
And we have the highlighted values (duplicate values) filtered only.
You now may choose to cut/paste them, delete them or treat them in any way you like 🙈
That’s it – Now what?
The above article is a complete guide on how to find and remove duplicates in Excel. Like reading it?
If you did, you’d be amazed to know how versatile Microsoft Excel is. And the best part of Excel is that it has a huge (and that’s an emphasized huge) library of functions 📚
Each function of Excel is super smart and useful when used the right way. To master Excel functions, you must have a good grip on some core functions of Excel.
These include the VLOOKUP, SUMIF, and IF functions. To learn them, enroll in my 30-minute free email course now. It covers these (and many more) Excel functions, features, and tools.
Frequently asked questions
To delete duplicates from any dataset in Excel.
- Select the column header for the column that contains the duplicate values.
- Go to the Data Tab > Remove Duplicates.
- Under the Remove Duplicate dialog box, select the subject column.
- Check the box for “My data has headers” if the column has any.
- Click “Okay”.
To quickly delete duplicates, use the in-built tool for duplicate removal in Excel as below:
- Select the column header for the column that contains the duplicate values.
- Go to the Data Tab > Remove Duplicates.
- Under the Remove Duplicate dialog box, select the subject column.
Check the box for “My data has headers” if the column has any and click “OK”.
Kasper Langmann2023-01-21T18:45:48+00:00
Page load link
Quickly Find and Delete Duplicates in Excel Worksheets
by Avantix Learning Team | Updated February 20, 2022
Applies to: Microsoft® Excel® 2013, 2016, 2019, 2021 and 365 (Windows)
You can remove duplicates in Excel in several ways. When you use the Remove Duplicates tool, Excel will keep the first instance and the remaining duplicates in the data set will be deleted. It’s common to remove duplicate rows in a list or data set so that the data can be sorted, filtered and summarized. You’ll need to decide what you consider to be a duplicate (based on one or more fields or columns).
Recommended article: How to Highlight Errors, Blanks and Duplicates in Microsoft Excel
Do you want to learn more about Excel? Check out our virtual classroom or in-person Excel courses >
In this article, we’ll review 3 easy ways to remove or delete duplicates in Excel:
- Using Remove Duplicates on the Data tab in the Ribbon
- Using Remove Duplicates on the Table Design or Table Tools Design tab in the Ribbon
- Creating a formula to remove duplicates if there are extra spaces in the data
The process is to identify the duplicates and then delete the duplicate rows.
For all of the techniques below, the list or data set should have:
- Unique header names in the header row
- No blank rows
- No blank columns
- No merged cells
If you have used the Subtotal feature to add subtotals, you should remove them. If you are planning on using structured reference formulas in Excel tables, it’s easier if the field names do not include spaces.
Note: Screenshots in this article are from Excel 365 but are similar in previous versions of Excel.
In the sample data set below, the data includes unique headers and duplicate records but no blank rows or columns:
Before removing duplicates, you may want to save a copy of the worksheet or workbook so you can keep the original data.
1. Remove duplicates using Remove Duplicates on the Data tab in the Ribbon
To remove or delete duplicates from a data set using Remove Duplicates on the Data tab in the Ribbon:
- Select a cell in the data set or list containing the duplicates you want to remove. If the data set has blank rows or columns within it, you’ll need to select the data first (click in the first cell and Shift-click in the last cell).
- Click the Data tab in the Ribbon.
- Select Remove Duplicates in the Data Tools group. A dialog box appears.
- Assuming your data set or list has headers, ensure My data has headers is checked.
- In the columns area, select or check the field(s) containing the duplicates you want to remove. You can select one or more fields (columns) or All. A dialog box appears indicating how many records will be removed.
- Click OK.
Excel will remove duplicates, keep the first record of the duplicate records and provide a summary of the number of rows that have been removed.
To use a keyboard shortcut to access the Remove Duplicates command on the Data tab on the Ribbon, press Alt > A > M (press Alt, then A, then M).
Remove Duplicates appears in the Data Tools group on the Data tab in the Ribbon:
In the following example, the Remove Duplicates dialog box appears with 3 fields from the data set:
2. Remove duplicates in an Excel table
If your data is formatted as an Excel table (typically by pressing Ctrl + T), you can remove the duplicates using the Table Design or Table Tools Design tab in the Ribbon.
To remove duplicates in an Excel table:
- Click in the table that contains the duplicates you want to remove.
- Click the Table Design or Table Tools Design tab in the Ribbon.
- Select Remove Duplicates in the Tools group. A dialog box appears.
- Assuming your table has headers, ensure My data has headers is checked.
- In the columns area, select or check the field(s) containing the duplicates you want to remove. You can select one or more fields (columns) or All. A dialog box appears indicating how many records will be removed.
- Click OK.
Excel will remove duplicates and provide a summary of the number of rows that have been removed.
Remove Duplicates appears in the Tools group in the Table Design or Table Tools Design tab in the Ribbon:
You can also use the Remove Duplicates command on the Data tab for a table.
3. Remove duplicates using a formula
You can enter a formula to help you identify duplicates that may have extra spaces and are not recognized as a duplicate.
The following strategy includes:
- The TRIM function to remove spaces between words as well as leading and trailing spaces
- The CONCATENATE operator (&) to combine cells (although you can use the CONCATENATE or CONCAT functions as well)
You will need to create a new calculated column (or helper column) in your data and then you can use the Remove Duplicates command.
For example, if you wanted to combine the data from A2 and B2 and remove extra spaces in a cell (such as C2), you could create the following formula:
=TRIM(A2) & TRIM(B2)
In the following example (which includes first names and last names), we’ve entered a formula =TRIM(A2) & TRIM(B2) in C2 and then copied the formula down to the cells below by dragging the Fill handle on the bottom right corner of the cell:
If you want to combine cells from columns in a table (which includes columns for first name and last name) and remove extra spaces, you could create the following formula in the first data cell in a new calculated column as a structured reference formula where you refer to field names:
=TRIM([@[First Name]]) & TRIM([@[Last Name]])
Excel will populate the formula for the entire column when you press Enter.
In the table example below, the structured reference formula using TRIM and the CONCATENATE operator is entered in C2 and Excel color codes the references:
If there are no spaces in the field names, you can enter the formula in C2 in the table as follows:
=TRIM([@FirstName]) & TRIM([@LastName])
Once you have created the helper or calculated column, to remove duplicates, click in the data set or table and use the Remove Duplicates command in the Ribbon (using the methods above) and check only the calculated column in the dialog box.
For other ways to combine cells, check out How to Combine Cells in Excel Using CONCATENATE (3 Ways).
Subscribe to get more articles like this one
Did you find this article helpful? If you would like to receive new articles, JOIN our email list.
More resources
How to Merge Cells in Excel (4 Ways with Shortcuts)
How to Insert Multiple Rows in Excel (4 Fast Ways with Shortcuts)
3 Excel Strikethrough Shortcuts to Cross Out Text or Values in Cells
Use Conditional Formatting in Excel to Highlight Dates Before Today (3 Ways)
How to Replace Blank Cells in Excel with Zeros (0), Dashes (-) or Other Values
Related courses
Microsoft Excel: Intermediate / Advanced
Microsoft Excel: Data Analysis with Functions, Dashboards and What-If Analysis Tools
Microsoft Excel: Introduction to Power Query to Get and Transform Data
Microsoft Excel: New and Essential Features and Functions in Excel 365
Microsoft Excel: Introduction to Visual Basic for Applications (VBA)
VIEW MORE COURSES >
Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you’d like to arrange custom instructor-led virtual classroom or onsite training on a date that’s convenient for you.
Copyright 2023 Avantix® Learning
Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.
Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at info@avantixlearning.ca
Learn how to find, filter, and remove duplicates in Excel using quick and creative methods. If you are working with large data tables, it’s helpful to find unique values or remove duplicate values.
Our goal is to show you how to use Excel’s built-in data cleansing tools to find unique values in single or multiple columns.
Here we go; let us see how it works.
Table of contents:
- How to remove duplicates in Excel for a single column
- Find and remove duplicates in Excel for multiple columns
- Filtering for unique values and removing duplicate values
- Find and remove duplicate values using Conditional Formatting
- Remove duplicate data using Power Query
- Use Excel UNIQUE function to remove duplicates
- Working with Pivot Tables
- Find and remove duplicates using Formulas
- Build a macro to remove duplicate values
- Use DataXL free add-in
Download the practice file.
What is a duplicate value? Things to consider…
A comparison of duplicate values depends on what appears in the cell. So it’s not about the original value stored in the cell. Check the example below!
Let’s say that our range contains the same date value in multiples cells with various formatting.
If we apply the ‘Remove duplicates’ command, we will get unique values without duplicates. Why? We are talking about unique values, but the cell format is different!
We recommend you format the data before you start using the function.
Tip: The remove duplicates tool, delete your duplicates permanently.
How to remove duplicates in Excel for a single column
In the first example, we’ll show you how to check for duplicates from a single column (list) and keep unique rows. As first, select the range which contains duplicated values.
1. Locate the ribbon, and click on the Data Tab.
2. A new window will appear by clicking on ‘Remove Duplicates.’
3. Finally, click the OK button. A small message box will appear. It contains helpful information about the numbers of removed duplicates and unique values. Click OK to close the window.
Important: Now, decide your data contains a header or not. If your range has a header, make sure the status of the ‘My list has headers’ box is checked. If you don’t do that, you’ll get a false result.
Find and remove duplicates in Excel for multiple columns
If you want to remove duplicates in more than one column (and keep unique rows), use the following method. At first glance, the’ Remove Duplicates’ is a swiss knife in Excel. But we kindly ask you, use it carefully. We’ll show you why. If you use the tool on a range containing multiple columns, the results can be different.
There are three sample outputs for the ‘Rep,’ ‘Regions,’ and ‘OrderDate’ columns in the examples below. First, as we mentioned before, click on the ribbon and select the ‘Remove Duplicates’ command.
Example 1
The first image displays all the duplicates based only on the Sales rep. After removing duplicates, nine unique values remain.
Example 2
The second image shows all the duplicates based on the Rep and Region columns. After clicking OK, based on two columns, Excel removes four duplicate values, and ten unique values remain.
Example 3
The third image shows all the duplicates based on all columns in the table. In this case, 12 unique values remain.
Don’t forget: Before we start, let’s quickly compare removed items to check how the different filters work. You can check for duplicates in many different ways, and it depends on your task.
Filtering for unique values and removing duplicate values
This part of the tutorial will explain the differences between filtering (hiding) and removing duplicate values. At first glance, there are two similar tasks: their objective is to create a list of unique values.
It’s a smart decision to apply filters before removing duplicates. Try to switch the advanced filter on or use simple conditional formatting to avoid unexpected results.
To filter unique values, follow the steps below.
1. Select the range or a table. Tip: It’s good enough to select a single cell in a range.
2. Click the Data Tab and select the ‘Advanced Filter‘ under the ‘Sort & Filter’ group.
3. Now, the ‘Advanced Filter’ box appears. You have two choices to apply the filter.
In the first example, we temporarily hide the duplicate values and keep the list in place. To do that, select ‘Filter the list, in-place,’ check the ‘Unique records only’ box. Then, click OK to close the window.
Check the result! If you are using an advanced filter for unique values, duplicates are only hidden temporarily. Take a closer look at the picture below! This is a filtered list that contains all records.
In the second example, we’ll show you how to copy the unique records to another location and keep the original list in place. To do that, select the ‘Copy to another location’ checkbox, then select the unique records only. Click OK. Finally, select the target location to copy the result to another worksheet.
Find and remove duplicate values using Conditional Formatting
Conditional formatting is a versatile tool; we love it! Let’s see how to highlight duplicate values in a single column:
As first, we have to talk about an important step. It’s important to select all cells in a range! It is a limitation of formatting rules.
Go to the Home tab and locate the Style group.
Click the small arrow for Conditional Formatting from the drop-down list, and then click Highlight Cells Rules. Finally, select Duplicate Values.
The method is perfect if we want to remove duplicates in a single column.
How to find unique or duplicate values using multiple columns?
Because conditional formatting cannot work with records across rows, we will apply a small trick. First, create a helper column and use the CONCAT function to create a single string without spaces.
We’ll use this combined column to check for duplicates in more than one column.
The first three steps are the same as the single-column example:
Click Conditional Formatting > Highlight Cells Rules > Duplicate values.
Select the’ Duplicate’ option from the drop-down list if you want to highlight the duplicate values for three columns. Then, apply a built-in or a custom formatting style. The result is below:
Tip: If you need to take a quick overview of duplicates, use the Quick Analysis Tool.
Select the range which contains duplicates. A small icon will appear at the end of the range. Choose the ‘Formatting’ tab and select ‘Duplicates’ from the list. You can use the ‘Ctrl + ‘Q’ shortcut too.
Find And Remove Duplicate Data using Power Query
Select the range that you want to add to the Power Query Editor. Then, select the Data Tab in the ‘Get and Transform’ section, choose the ‘From Table / Range’ option.
Now the Power Query window appears. In this case, select the first column, ‘Rep.’ Right-click and apply the ‘Remove Duplicates’ command.
Working with multiple columns
The Power Query-based method works on single or multiple ranges.
Example 1: If you need to find duplicate rows based on the entire table, hold the ‘Control’ key and select the column by clicking headers.
Example 2: Quick tip to keep distinct values based on the entire range: Check the table icon on the first column’s header. Right-click, then click remove duplicates. It’s easy!
Pivot Tables
In this example, we’ll show you how to remove duplicates using Pivot Tables.
- Select data.
- Click the Home Tab and Insert a Pivot Table.
- Make sure to drag all three fields into the Rows section.
Go to the Design Tab and transform the Pivot table using the steps below.
Click on the Pivot Table area:
- Select ‘Subtotals’, and click ‘Do Not Show Subtotals‘
- Switch off showing ‘Grand Totals’ using the drop-down list
- Under the ‘Report Layout’ section click ‘Show data in Tabular Form’ and ‘Repeat All Item Labels’
Good to know that the Pivot table lists unique values only. If you create a proper report layout, the Pivot table removes duplicate rows.
Create a unique list using Excel UNIQUE function
If you are using the latest Office release (Office365+ and above), we have good news. Using the UNIQUE function, you can create a unique list in one single step.
This function is currently available only to Microsoft 365 subscribers.
Find and remove duplicates using classic Formulas
A comparison of duplicate values depends on what appears in the cell. So, it’s worth using formulas and functions to remove duplicates properly.
Let’s see the example below!
We will create a helper column and join the data, which are in three columns. But, first, add a name to the new column, in this case, ‘Joined records.‘
Combine the records using the Excel CONCAT function:
=CONCAT(Rep, Region, OrderDate)
With the help of the COUNTIFS function, we’ll take a quick overview of the number of duplicate values. Create a new column, ‘Count Duplicates.’
Enter the formula, then evaluate:
=COUNTIFS($D$2:$D$15,D2)
The result:
Copy the formula down until cell E15. The COUNTIFS function will show the duplicates quickly.
Take a closer look at the output:
- We are talking about distinct values if the result = 1
- If it’s greater than 1, the value appears in the list more than once
I’ve just highlighted the duplicate values using orange fill.
To remove duplicates apply a filter using the Ctrl + Shift + L keyboard shortcut and select the duplicate rows using the drop-down list.
Build a macro to remove duplicate values
Okay, if VBA is your friend, we’ll show some small snippets to keep unique rows.
Tips:
- If the range does not have a header, then use Header:=‘xlNo’
- If the range has header, then use Header:=‘xlYes’
Example 1: Our range is A1:C15, the range has a header, and we want to remove duplicates from the first column. The code is the following:
Sub Example1()
Range("A1:C15").RemoveDuplicates Columns:=1, Header:=xlYes
End Sub
Example 2: The range is the same as above, and we want to remove duplicates from the first and the third columns:
Sub Example2()
Range("A1:C13").RemoveDuplicates Columns:=Array(1, 3), Header:=xlYes
End Sub
Use DataXL free add-in
DataXL is our answer to data cleansing challenges! Coming soon!
Additional resources:
- Freeze Panes in Excel