How To Find Duplicates in Excel [Easy 2024 Guide]

Learning how to find duplicates in Excel isnโ€™t a complex task โ€”ย but itโ€™s an important one. Excel provides several methods to locate duplicates, whether youโ€™re highlighting them, filtering them out, or creating a separate list of unique values.

To improve navigation and work with data more efficiently, weโ€™ll explore different techniques to find duplicates in Excel. Read on to find the perfect solution for your needs.

Whyย Do You Need to Search for Duplicates in Excel?

Accidental duplicates can occur in various scenarios, such as importing data, merging datasets, or manually entering information. In any of these cases, the repeated data can be redundant and cause many different calculation errors.

Finding duplicates can help you identify and manage data inconsistencies, ensure accuracy, and streamline your analysis.

How To Find Duplicates in Excel

There are several methods for finding duplicates in Excel. The most common and useful are the following:

  1. Using conditional formatting
  2. Using the COUNTIF Function
  3. Using the UNIQUE Function

To showcase how to check for duplicates in Excel in detail, all of our examples use the following data:

How to find duplicates in Excelโ€”An example data set with names, locations and departments

Finding Duplicates in Excel with Conditional Formatting

Conditional formatting in Excelย allows you to format cells based on specific criteria or conditions. You can also use it to highlight duplicatesย appearing in your worksheet.

Hereโ€™s how to identify duplicates in Excel using conditional formatting:

  1. Select the data.
A screenshot showing selected data in Excel
  1. Go to the โ€œHomeโ€ tab and click โ€œConditional Formatting.โ€
A red box showing where the conditional formatting menu item is
  1. Choose the option โ€œHighlight Cell Rulesโ€ >ย โ€œDuplicate Values.โ€
Red markup boxes showing the file patch for opening duplicate values.
  1. In the prompt, choose whether to highlight unique values or duplications.
A red markup box indicating where to select if you want to highlight duplicates or unique values
  1. Choose the color you want to highlight in the color drop-down.
A red markup box showing the duplicate values drop-down menu for highlighting options
  1. Click โ€œOK.โ€
Highlighted duplicates using conditional formatting in Excel

There you go! The cells with values appearing more than once will be highlighted in your chosen format.

How To Find Duplicates Using Conditional Formatting, Excluding the First ย Occurrence

You can also highlight the duplicatesย exceptย for the first instances of the value. Hereโ€™s how to show duplicates in Excel except for the first instances.

  1. Clear all conditional formatting. Go to โ€œConditional Formattingโ€ > โ€œClear Rulesโ€ >ย โ€œClear Rules from Selected Cells.โ€
Red markup showing how to select and Clear Rules from Selected Cells in Excel
  1. Select the data.
Cells C1:C13 selected in the data set
  1. Go to โ€œConditional Formattingโ€ >ย โ€œNew Rule.โ€
Red markup showing the file path to add a new rule
  1. Select the option โ€œUse a formula to determine which cells to format.โ€
Red markup showing how to use a formula to determine a cells format in Excel
  1. In the text box for ย โ€œFormat Values where this formula is true,โ€ enter the formula:
=COUNTIF($C$1:C1,C1)>1

This formula will depend on the first cell of your selected data. In our case, we selected column C. Therefore, the first cell is C1.ย However, if your range starts in column B, you would use B1.

A red markup box showing where to enter the COUNTIF formula in Excel
  1. Click on the โ€œFormatโ€ย button.
The format menu for adding this rule
  1. In the new prompt, go to the โ€œFillโ€ย tab.
The fill tab for formatting duplicates in Excel
  1. Choose the formatting options you want to use and Click โ€œOK.โ€
The exampls spreadsheet with highlighted duplicates without the 1st instances

Thatโ€™s it! Thanks to the custom formula, the cells with the first instances of the duplicates wonโ€™t be highlighted in your range.

How To Find Duplicates Using the COUNTIF Function

You can also use the COUNTIF functionย to find duplicates in Excel. COUNTIF uses conditions to count the number of cells within a range.

The Basics of the COUNTIF Function

The syntax of the COUNTIF function is as follows:

COUNTIF(range, criteria)
Range can be a single column, row, or combination of both.

Criteriaย can be a specific value, cell reference, text string, wildcard pattern, or logical expression.

Guide for Using the COUNTIF Function in Excelย to Find Duplicates

On its own, the COUNTIF formula will return either TRUE or FALSE if thereโ€™s a duplicate. To make it more intuitive, we can wrap it in the IF function to return a more understandable option.

In our example spreadsheet, weโ€™ll find the duplicates in column B using the formula:

=IF(COUNTIF($B$2:$B13, $B2)>1, "Duplicate", "")

Letโ€™s break that formula down:

  1. In a new column, type:
    =IF(COUNTIF(
  2. After the opening brackets, select the range Excel will use to find duplicates.
  3. Click the F4 button to lock the cell for the formula into using an absolute reference.
  4. Add a comma and select the first cell again. Lock it with the F4 button.
  5. Close the brackets and add >1
  6. Add a comma and type the word โ€œDuplicateโ€ (Note: You can choose any word youโ€™d prefer.)
  7. Add a comma and empty quotation marks to return a blank when thereโ€™s no duplicate.
  8. Add a closing bracket.
An example of using the COUNTIF formula in Excel to highlight duplicates

This formula will return the word duplicate for every cell with a duplicate, including the first instance.

How To Use COUNTIF and IF to Highlight Duplicates, Ignoring the First Instance

If you want the function to ignore the first instances, use the following formula instead:

=IF(COUNTIF($B$2:$B2, $B2)>1, "Duplicate", "") 
An example using the COUNTIF formula without the 1st instances

How To Check for Duplicates in Excel Using the UNIQUE Function

A new list of unique values to check duplicates next to the initial data points

To find values that appear only once, we recommend using the UNIQUE function in Excel. This is a great way to quickly find values that have been duplicated in your worksheet using the UNIQUE function:

=UNIQUE(range) 
  1. Ensure that your data is organized in a column or range. Choose the range of cells.
  2. Select an empty column where unique values will be displayed.
  3. In the first cell of the empty column, enter the following formula and press โ€œEnterโ€
    =UNIQUE(range)

In our example, our data range is A1:A13. Therefore, the formula would be:

=UNIQUE(A1:A13)

The UNIQUE function will generate a list of unique values from the selected range, starting from the cell where you entered the formula. The duplicates will be omitted, and only distinct values will be displayed.

Compare the number of unique values returned with the total number of values in the original range. If the counts differ,ย duplicates will appear in your data.

This is a great method to determine whether values have duplicates, but it isnโ€™t efficient at identifying where each instance occurs. Youโ€™ll be better off highlighting the duplicates using conditional formatting (in the methods described above).

How To Find Triplicates in Excel

To find triplicates in Excel, we recommend using the COUNTIF function. You can use the same formula we used (above) โ€”ย but with a few tweaks:

Use this formula to find triplicates:

=IF(COUNTIF($B$2:$B13, $B2)>2, "Triplicate", "")
Triplicates highlighted in Excel worksheet

This formula returns the word โ€œTriplicateโ€ when there are three or more instancesย of a value.ย In this case, the word โ€œCaliforniaโ€ appears 4 times in the range, which shows the word triplicate in column D. Otherwise, the formula returns a blank.

If you only want items to show in your list if they appear exactlyย three times, useย =3 as an operatorย (instead of >2).

For example:

=IF(COUNTIF($B$2:$B13, $B2)=3, "Triplicate", "")

Related:ย Google Sheets vs. Excel

How To Filter Duplicates in Excel

To filter duplicates in Excel to display unique values, use the built-in filtering capabilities:

  1. Use the COUNTIF function to show duplicates. In our example, weโ€™ll use the following formula (which does not include the first instance):
ย =IF(COUNTIF($B$2:$B2, $B2)>1, "Duplicate", "") 
Sample results for using the COUNTIF function to show duplicates
  1. Select the range of cells that you want to filter for duplicates.
  2. Go to the โ€œDataโ€ย tab in the Excel toolbar.
Red markup showing how to go to the Data tab in the Excel ribbon.
  1. Click the โ€œFilterโ€ button to add filter arrows to column headers.
Red markup showing where to click on the Filter button in excel finding duplicate
  1. Select the column you want to filter. Click on the filter arrow in the column header.
A red markup box showing the filter arrow in the column header for duplicates.
  1. In the drop-down menu of the formula column, uncheck โ€œSelect Allโ€ย to clear all selections. Instead, select โ€œDuplicate.โ€
    • To show the cells without duplicates, you can select โ€œblanksโ€ย instead of โ€œduplicates.โ€
Scroll down the list and look for the option Duplicate.
  1. Click โ€œOKโ€ย or press โ€œEnter.โ€
A screenshot showing the filter results from the above steps

How To Find Duplicate Rows in Excel

If you want to find duplicate rows in Excel, you can use conditional formatting and built-in functions:

  1. Go to โ€œConditional Formattingโ€ and select โ€œClear Rulesโ€ >ย โ€œClear Rules from Selected Cells.โ€
  2. Select the range of cells to find duplicate rows.
  3. Go to โ€œConditional Formatting.โ€
  4. Click on โ€œNew Rule.โ€
  5. Select โ€œUse a formula to determine which cells to format.โ€
  6. In the text box for ย โ€œFormat Values where this formula is true,โ€ and enter the following formula:
ย =COUNTIFS($A$1:$A$13,$A1,$B$1:$B$13,$B1,$C$1:$C$13,$C1)>1. 

This formula depends on the first cell of your selected data for each column. In our example, we have three columns, so itโ€™s important to change the cell values accordingly.

"format values where this formula is true" box
  1. Click on โ€œFormatโ€ > โ€œFill.โ€
  2. Choose the formatting options you want to use and click โ€œOK.โ€
Highlighted rows in Excel from using COUNTIIFS

As you can now see, the formula will highlight the duplicated rows.

How To Count the Number of Duplicates in Excel

Toย count the number of times a value has been repeated in your worksheet, we recommend using the COUNTIF function. In this example, weโ€™ll work with column B:

The formula weโ€™ve used for this example is:

=COUNTIF($B$2:$B$13,B2) 
  1. In the cell, type:
    =COUNTIF(
  2. Select the column.
  3. Click F4 to lock the cell reference as an absolute value.
  4. Add a comma, select the first cell of the selected range, and close with ).
Results in Excel from using COUNTIF to show duplicate counts

The formula shows how many times each word in column B appears in the data. In our example, you can see that โ€œNew Yorkโ€ appears twice, and โ€œCaliforniaโ€ shows up four times.

Frequently Asked Questions

How Do You Count Duplicates in Sheets?

The most efficient way toย count the number of duplicates in Google Sheets isย with the COUNTIF function.

For example, to search for duplicates in cells B2 to B13, you could use the following formula:

=COUNTIF($B$2:$B$13,B2) 

How Do I Find Duplicates in Excel but Keep One?

The best way is to filter out the duplicates. Use the COUNTIF formula to find duplicates without the first instance.

Once youโ€™ve filled in the COUNTIF formula for the applicable data:

  1. Select all the data, including the formula
  2. Select โ€œDataโ€ > โ€œFilterโ€ย to add filter arrows to the column headers.
  3. Click on the filter arrow in the column’s header youโ€™re filtering.
  4. Uncheck โ€œSelect Allโ€ in the formula columnโ€™s drop-down menu to clear all selections.
  5. Scroll down the list and check โ€œDuplicate.โ€
  6. Click โ€œOKโ€ or press โ€œEnter.โ€

You can check out the โ€œHow to Filter Duplicates in Excelโ€ heading above for a more detailed guide on using the Filter function with duplicates.

What Is the Best Excel Formula to Find Duplicates?

To find duplicates in Excel, we recommend using the COUNTIF function. This function counts the number of occurrences within a range. By using it with criteria ofย “>1”, itโ€™s easy to identify cells with duplicate values.

If you nest it in theย IF function, you can select the values for returning duplicates.

For example, the following function would return โ€œDuplicate.โ€

ย =IF(COUNTIF($B$2:$B2, $B2)>1, "Duplicate", "") 

Wrapping Up

Using what youโ€™ve learned in this article, you should know how to find duplicates in Excel using the UNIQUE function, the COUNTIF function, and conditional formatting. Feeling inspired? Discover how to become an expert with the best online Excel courses.

Want to skip the learning curve? Get your hands on ready-to-use premium spreadsheet templates. When you use the code โ€œSSP,โ€ youโ€™ll save 50% on all purchases!

Get Premium Templates

Related:

Most Popular Posts

Related Posts

Thanks for visiting! We’re happy to answer your spreadsheet questions. We specialize in formulas for Google Sheets, our own spreadsheet templates, and time-saving Excel tips.

Note that we’re supported by our audience. When you purchase through links on our site, we may earn commission at no extra cost to you.

Like what we do? Share this article!