Deleting duplicates from excel

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.

  1. The first image highlights all the duplicates based only on the Make of the car.
  2. The second image highlights all the duplicates based on the Make and Model of the car. This results in one less duplicate.
  3. 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.

  1. 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.
  2. 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.

  1. 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.
  2. 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.
  3. 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.

  1. Select the Show in Tabular Form option.
  2. 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 RowsRemove 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 RowsKeep 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 FormattingHighlight Cells RulesDuplicate Values.

This will open up the conditional formatting Duplicate Values window.

  1. You can select to either highlight Duplicate or Unique values.
  2. 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.

  1. Click on the filter toggle.
  2. Select Filter by Color in the menu.
  3. 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 MacDougall

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.

This wikiHow teaches you how to remove duplicate entries from a Microsoft Excel spreadsheet.

  1. Image titled Remove Duplicates in Excel Step 1

    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. Image titled Remove Duplicates in Excel Step 2

    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. Image titled Remove Duplicates in Excel Step 3

    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. Image titled Remove Duplicates in Excel Step 4

    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. Image titled Remove Duplicates in Excel Step 5

    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. Image titled Remove Duplicates in Excel Step 6

    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. Image titled Remove Duplicates in Excel Step 7

    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. Image titled Remove Duplicates in Excel Step 8

    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. Image titled Remove Duplicates in Excel Step 9

    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. Image titled Remove Duplicates in Excel Step 10

    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. Image titled Remove Duplicates in Excel Step 11

    5

    Select Highlight Cells Rules. You’ll see a window pop out from here.

  6. Image titled Remove Duplicates in Excel Step 12

    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

  • Anonymous

    «Simple click that save me tons of time sorting and filtering.»

Is this article up to date?

Skip to content

How to Remove Duplicates in Excel (and Find Them)

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.

List of names

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:

  1. Select the data that needs to be filtered.
Selection of data
  1. Go to the Data Tab > Advanced Filters.
Advanced filters

This opens up the Advanced Filter dialog box as follows 👀

The advanced filter dialog box

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:

 The Action Box to find duplicate rows
  • 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.
  1. Check the option for Unique Records only. This tells Excel to delete any dupes from the dataset.
Advanced Filter popup box
  1. Click Okay.

Here comes the data which no longer has duplicates 🤩

Deduped dataset

Note that we had selected the option to Filter in place so our original dataset has changed.

Kasper Langmann, Microsoft Office Specialist

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:

  1. Select the column header for the column that contains the duplicate values (List of Names in our example).
Selection of the column header
  1. Go to the Data Tab > Remove Duplicates.
Remove duplicats feature
  1. Select the column from where the duplicates are to be removed. Note that it is already selected in our case.
  2. Check the box for “My data has headers” as highlighted below.
Duplicate records removal
  1. 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 🚀

Duplicate values dialog box

Here is the deduped list. Excel has found and removed all instances of duplication 💪

 List of unique values

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.

Kasper Langmann, Microsoft Office Specialist

So to extract a list of unique names from our dataset:

  1. Begin writing the UNIQUE function as follows ✍

= UNIQUE

Writing the UNIQUE function
  1. Specify the range that needs to be filtered.

= UNIQUE (A2:A8)

Specifying the range

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.

  1. Hit Enter, and there are your filtered values.
UNIQUE function returns unique 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.

Find duplicate values in Excel

This time we only need to find out the duplicate values from this list, so here we go.

  1. Select the data (from where you want to find the duplicates).
Selection of data
  1. Go to the Home Tab > Conditional Formatting.
Home Tab > Conditional Formatting
  1. From the drop-down menu that appears, select Highlight Cell Rules > Duplicate values 🎨
Highlight duplicate values

This way the conditional formatting tool of Excel will highlight duplicates from the selected dataset.

Like in the image below.

Highlight Duplicate rows

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 👇

  1. Select the header for the subject column (List of Names in our example).
  2. Go to the Data tab > Filter.
Filter option to filter out duplicate rows

Once the filters are applied, you’d see the filter icon (drop-down menu icon) inside the selected column header.

  1. Click on that drop-down menu icon 🔽
  2. From the context menu that opens up, select Sort by Color > Red.
Sort by color

And we have the highlighted values (duplicate values) filtered only.

Remove duplicate rows

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.

  1. Select the column header for the column that contains the duplicate values.
  2. Go to the Data Tab > Remove Duplicates.
  3. Under the Remove Duplicate dialog box, select the subject column.
  4. Check the box for “My data has headers” if the column has any.
  5. Click “Okay”.

To quickly delete duplicates, use the in-built tool for duplicate removal in Excel as below:

  1. Select the column header for the column that contains the duplicate values.
  2. Go to the Data Tab > Remove Duplicates.
  3. 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

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. 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

How to Find and Remove Duplicates in Excel — Find duplicate rows

  1. 2. Go to Data > Remove duplicates.

How to Find and Remove Duplicates in Excel 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”.

  1. 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

How to Find and Remove Duplicates in Excel — Remove headers from duplicate search

  1. 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 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 Combine Multiple Excel Columns Into One

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. 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

How to Find and Remove Duplicates in Excel — Advanced filter

  1. 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

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.

  1. 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

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. 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

How to Find and Remove Duplicates in Excel — UNIQUE formula

  1. 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

How to Find and Remove Duplicates in Excel — UNIQUE function

  1. 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

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. 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

How to Find and Remove Duplicates in Excel — FALSE UNIQUE formula

  1. 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 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. 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

How to Find and Remove Duplicates in Excel — Conditional formatting

  1. 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

How to Find and Remove Duplicates in Excel — Conditional formatting remove duplicates

  1. 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

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. 1. Go to Data > Get Data (Power Query).

How to Find and Remove Duplicates in Excel Power Query

How to Find and Remove Duplicates in Excel — Power Query

  1. 2. Choose “Excel workbook” as your data source.

How to Find and Remove Duplicates in Excel Power Query data source

How to Find and Remove Duplicates in Excel — Power Query data source

  1. 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

How to Find and Remove Duplicates in Excel — Power Query load data

  1. 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 2

How to Find and Remove Duplicates in Excel — Power Query load data

  1. 5. As you can see, the dataset has been transformed into a table.

How to Find and Remove Duplicates in Excel Power Query table

How to Find and Remove Duplicates in Excel — Power Query table

  1. 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 2

How to Find and Remove Duplicates in Excel — Power Query table

  1. 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 2

How to Find and Remove Duplicates in Excel — Remove Duplicates

  1. 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

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.

Watch Video – How to Find and Remove Duplicates in Excel

With a lot of data…comes a lot of duplicate data. 

Duplicates in Excel can cause a lot of troubles. Whether you import data from a database, get it from a colleague, or collate it yourself, duplicates data can always creep in. And if the data you are working with is huge, then it becomes really difficult to find and remove these duplicates in Excel.

Find and Remove Duplicates in Excel - Image

In this tutorial, I’ll show you how to find and remove duplicates in Excel.

CONTENTS:

  1. FIND and HIGHLIGHT Duplicates in Excel.
    • Find and Highlight Duplicates in a Single Column.
    • Find and Highlight Duplicates in Multiple Columns.
    • Find and Highlight Duplicate Rows.
  2. REMOVE Duplicates in Excel.
    • Remove Duplicates from a Single Column.
    • Remove Duplicates from Multiple Columns.
    • Remove Duplicate Rows.

Find and Highlight Duplicates in Excel

Duplicates in Excel can come in many forms. You can have it in a single column or multiple columns. There may also be a duplication of an entire row.

Finding and Highlight Duplicates in a Single Column in Excel

Conditional Formatting makes it simple to highlight duplicates in Excel.

Here is how to do it:

  • Select the data in which you want to highlight the duplicates.

Find and Remove Duplicates in Excel - Single Column

  • Go to Home –> Conditional Formatting –> Highlight Cell Rules –> Duplicate Values.

Find and Remove Duplicates in Excel - Conditional Formatting Duplicate Values Option

  • In the Duplicate Values dialog box, select Duplicate in the drop down on the left, and specify the format in which you want to highlight the duplicate values. You can choose from the ready-made format options (in the drop down on the right), or specify your own format.

Find and Remove Duplicates in Excel - Specify Duplicate Color

  • This will highlight all the values that have duplicates.

Find and Remove Duplicates in Excel - Highlighted values in one column

Quick Tip: Remember to check for leading or trailing spaces. For example, “John” and “John ” are considered different as the latter has an extra space character in it. A good idea would be to use the TRIM function to clean your data.

Finding and Highlight Duplicates in Multiple Columns in Excel

If you have data that spans multiple columns and you need to look for duplicates in it, the process is exactly the same as above.

Here is how to do it:

  • Select the data.
  • Go to Home –> Conditional Formatting –> Highlight Cell Rules –> Duplicate Values.
  • In the Duplicate Values dialog box, select Duplicate in the drop down on the left, and specify the format in which you want to highlight the duplicate values.
  • This will highlight all the cells that have duplicates value in the selected data set.

Find and Remove Duplicates in Excel - Highlighted values in multiple columns

Finding and Highlighting Duplicate Rows in Excel

Finding duplicate data and finding duplicate rows of data are 2 different things. Have a look:

Find and Remove Duplicates in Excel - duplicate rowsFinding duplicate rows is a bit more complex than finding duplicate cells.

Here are the steps:

  • In an adjacent column, use the following formula:
    =A2&B2&C2&D2
    Drag this down for all the rows. This formula combines all the cell values as a single string. (You can also use the CONCATENATE function to combine text strings)

Find and Remove Duplicates in Excel - duplicate rows data combinesBy doing this, we have created a single string for each row. If there are duplicate rows in this dataset, then these strings would be exactly the same for it.

Now that we have the combined strings for each row, we can use conditional formatting to highlight duplicate strings. A highlighted string implies that the row has a duplicate.

Here are the steps to highlight duplicate strings:

  • Select the range that has the combined strings (E2:E16 in this example).
  • Go to Home –> Conditional Formatting –> Highlight Cell Rules –> Duplicate Values.
  • In the Duplicate Values dialog box, make sure Duplicate is selected and then specify the color in which you want to highlight the duplicate values.

This would highlight the duplicate values in column E.

Find and Remove Duplicates in Excel - highlight duplicate row stringIn the above approach, we have highlighted only the strings that we created.

But what if you want to highlight all the duplicate rows (instead of highlighting cells in one single column)?

Here are the steps to highlight duplicate rows:

  • In an adjacent column, use the following formula:
    =A2&B2&C2&D2
    Drag this down for all the rows. This formula combines all the cell values as a single string.

Find and Remove Duplicates in Excel - duplicate rows data combines

  • Select the data A2:D16.
  • With the data selected, go to Home –> Conditional Formatting –> New Rule.

Find and Remove Duplicates in Excel - New Rule

  • In the ‘New Formatting Rule’ dialog box, click on ‘Use a formula to determine which cells to format’.
  • In the field below, use the following COUNTIF function:
    =COUNTIF($E$2:$E$16,$E2)>1

Find and Remove Duplicates in Excel - Formula in CF

  • Select the format and click OK.

This formula would highlight all the rows that have a duplicate.

Find and Remove Duplicates in Excel - Duplicate rows highlighted

Remove Duplicates in Excel

In the above section, we learned how to find and highlight duplicates in excel. In this section, I will show you how to get rid of these duplicates.

Remove Duplicates from a Single Column in Excel

If you have the data in a single column and you want to remove all the duplicates, here are the steps:

  • Select the data.
  • Go to Data –> Data Tools –> Remove Duplicates.Find and Remove Duplicates in Excel - Data Remove Duplicates
  • In the Remove Duplicates dialog box:
    • If your data has headers, make sure the ‘My data has headers’ option is checked.
    • Make sure the column is selected (in this case there is only one column).

Find and Remove Duplicates in Excel - delete duplicate dialog box

  • Click OK.

This would remove all the duplicate values from the column, and you would have only the unique values.

CAUTION: This alters your data set by removing duplicates. Make sure you have a back-up of the original data set. If you want to extract the unique values at some other location, copy this dataset to that location and then use the above-mentioned steps. Alternatively, you can also use Advanced Filter to extract unique values to some other location.

Remove Duplicates from Multiple Columns in Excel

Suppose you have the data as shown below:

Find and Remove Duplicates in Excel - delete duplicates multiple row

In the above data, row #2 and #16 have the exact same data for Sales Rep, Region, and Amount, but different dates (same is the case with row #10 and #13). This could be an entry error where the same entry has been recorded twice with different dates.

To delete the duplicate row in this case:

  • Select the data.
  • Go to Data –> Data Tools –> Remove Duplicates.Find and Remove Duplicates in Excel - Data Remove Duplicates
  • In the Remove Duplicates dialog box:
    • If your data has headers, make sure the ‘My data has headers’ option is checked.
    • Select all the columns except the Date column.

Find and Remove Duplicates in Excel - delete duplicates multiple row selection

  • Click OK.

This would remove the 2 duplicate entries.

NOTE: This keeps the first occurrence and removes all the remaining duplicate occurrences.

Remove Duplicate Rows in Excel

To delete duplicate rows, here are the steps:

  • Select the entire data.
  • Go to Data –> Data Tools –> Remove Duplicates.Find and Remove Duplicates in Excel - Data Remove Duplicates
  • In the Remove Duplicates dialog box:
    • If your data has headers, make sure the ‘My data has headers’ option is checked.
    • Select all the columns.

Find and Remove Duplicates in Excel - delete duplicate row

  • Click OK.

Use the above-mentioned techniques to clean your data and get rid of duplicates.

You May Also Like the Following Excel Tutorials:

  • 10 Ways to Clean Data in Excel Spreadsheets.
  • Remove Leading and Trailing Spaces in Excel.
  • 24 Daily Excel Issues and their Quick Fixes.
  • How to Find Merged Cells in Excel.

Понравилась статья? Поделить с друзьями:
  • Deleting cells on excel
  • Delphi csv to excel
  • Deleting a blank page in word
  • Delphi bytes to word
  • Deleted data in excel