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.
Table of Contents
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:
To showcase how to check for duplicates in Excel in detail, all of our examples use the following data:
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:
- Select the data.
- Go to the โHomeโ tab and click โConditional Formatting.โ
- Choose the option โHighlight Cell Rulesโ >ย โDuplicate Values.โ
- In the prompt, choose whether to highlight unique values or duplications.
- Choose the color you want to highlight in the color drop-down.
- Click โOK.โ
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.
- Clear all conditional formatting. Go to โConditional Formattingโ > โClear Rulesโ >ย โClear Rules from Selected Cells.โ
- Select the data.
- Go to โConditional Formattingโ >ย โNew Rule.โ
- Select the option โUse a formula to determine which cells to format.โ
- 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.
- Click on the โFormatโย button.
- In the new prompt, go to the โFillโย tab.
- Choose the formatting options you want to use and Click โOK.โ
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:
- In a new column, type:
=IF(COUNTIF(
- After the opening brackets, select the range Excel will use to find duplicates.
- Click the F4 button to lock the cell for the formula into using an absolute reference.
- Add a comma and select the first cell again. Lock it with the F4 button.
- Close the brackets and add >1
- Add a comma and type the word โDuplicateโ (Note: You can choose any word youโd prefer.)
- Add a comma and empty quotation marks to return a blank when thereโs no duplicate.
- Add a closing bracket.
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", "")
How To Check for Duplicates in Excel Using the UNIQUE Function
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)
- Ensure that your data is organized in a column or range. Choose the range of cells.
- Select an empty column where unique values will be displayed.
- 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", "")
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:
- 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", "")
- Select the range of cells that you want to filter for duplicates.
- Go to the โDataโย tab in the Excel toolbar.
- Click the โFilterโ button to add filter arrows to column headers.
- Select the column you want to filter. Click on the filter arrow in the column header.
- 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.โ
- Click โOKโย or press โEnter.โ
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:
- Go to โConditional Formattingโ and select โClear Rulesโ >ย โClear Rules from Selected Cells.โ
- Select the range of cells to find duplicate rows.
- Go to โConditional Formatting.โ
- Click on โNew Rule.โ
- Select โUse a formula to determine which cells to format.โ
- 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.
- Click on โFormatโ > โFill.โ
- Choose the formatting options you want to use and click โOK.โ
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)
- In the cell, type:
=COUNTIF(
- Select the column.
- Click F4 to lock the cell reference as an absolute value.
- Add a comma, select the first cell of the selected range, and close with ).
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:
- Select all the data, including the formula
- Select โDataโ > โFilterโย to add filter arrows to the column headers.
- Click on the filter arrow in the column’s header youโre filtering.
- Uncheck โSelect Allโ in the formula columnโs drop-down menu to clear all selections.
- Scroll down the list and check โDuplicate.โ
- 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!
Related:
- How To Remove Duplicates in Excel
- How To Combine Rows in Excel
- 5 Ways You Can Merge Excel Files [10 Min Easy Guide]
- How To Solve the #SPILL Error in Excel [Easy Guide]
- How To Insert Bullet Points in Excel [Easy Guide]
- 4 Easy Examples of Greater Than or Equal To in Excel
- How To Randomize a List in Excel [Simple Guide]