How to Find Duplicates in Excel?
Often while dealing with large data in excel it is generally not an easy task, especially when performing certain tasks such as identifying duplicates in a range of data or by column. Which usually involves searching and deleting the duplicates or any combination where duplicates cells are needed to be encountered. Excel provides a perfect package to find or remove duplicates in many ways, which will help the user to blend the data as needed.
Let us view some of the methodologies and formulas with examples that are used to find, highlight and delete the duplicates in Excel
Search Duplicates in Excel using Conditional Formatting
Consider the below table, where we would like to identify and highlight the duplicates if any. This example uses conditional formatting to finding and highlight cells for duplicates in Excel. This feature is available in 2007 excel version and later.
Step 1:- Now we would like to find and highlight the duplicate in excel line items by column. Select the range of data to find the duplicates in excel.
Step 2:- Then go to Home to select Conditional Formatting and go to Highlight Cell Rules and we will find Duplicate Values.
Step 3:- Once the pop-up window appears, select “Duplicate” values and required color fills from the drop down to highlight the cells. Then click OK.
Step 4:– Once selections are done, below result is then highlighted for duplicate cells in the data table.
Step 5:- We can also filter on any column to find the duplicates in excel. This is done by right click in the required column to be filtered for duplicates.
Step 6:- Then go to filters and select “Filter by selected cell’s color”. This would enable you to filter only for duplicates.
Step 7:- Following is the result after applying the filter to column “Office Supplies”.
Finding Specific Numbers and Duplicates in Excel
Consider the following example if you would like to find and highlight the only specific number of duplications in excel, like the contents with three count of duplicates.
Step 1:- Select the range A2:C8 from the above data table.
Step 2:- Now go to Home tab, and in the style, group select conditional formatting and click on new rules.
Step 3:- Once you click new rules, a pop-up window would appear. Where you will need to select “Use a formula to determine which cells to format”. Then enter the formula for =COUNTIF (Cell Range for the data table, Cell Criteria) to determine which cells are needed to be identified and highlighted for the desired number of a count for duplicate cells.
In this case, I have marked to highlight only those cell contents for triplicate counts, this can also be changed to greater than three counts of duplicates or any other conditions as necessary.
Step 4:- Once the formula is entered, go to Format. There will be another pop-up window where the font and color fill tab is needed to be selected to find highlight the duplicate cells in excel.
In the Font tab, we have selected Regular. Whereas in the fill tab we have selected the blue shade to be highlighted for the desired duplicate cells.
Step 5:- Once the selections are made in the Format Cells. Click Ok.
Also, select OK for the new formatting rules window pop up as shown in step 3.
Step 6:- Below is the desired result displayed for the triplicate count of duplicates for the current example.
Step 7:- Clear Rules: Now if we again want to change the rules or formula from the data table. Then you need to first clear the rules for the entire sheet or the select cells.
Now go to the Home tab, select the conditional formatting in the style group. Then go to clear rules and select either of the below:-
Clear rules for the selected cells:- This will reset the rules for the selected range for data table only, this also requires selection of data table prior to clearing the rules.
Clear rules for the entire sheet:- This would clear the rules for the entire sheet.
Find and Delete Duplicates in Excel
The below example we will find and delete any duplicates in the select range in Excel. It is thereby advisable to keep a copy of the data table or workbook as the duplicates would be permanently deleted.
Now consider the below example for understanding the approach.
Step 1:- Now select the range for data table whose duplicates are required to be deleted. Next Go to Data, select Data Tools and remove duplicates.
Step 2:- Next to a pop-up window would appear, then by default, both the headers are selected where the duplicates are needed to be removed. The function will remove duplicates along with their corresponding rows.
Now to select all the columns, click on “Select All” checkbox, click on “My data has headers” if the first of the data table consists of column headers and if no columns or fewer columns are needed to be selected then click on “Unselect All” then further select the necessary columns where duplicates are needed to be deleted. Then click OK to execute.
Step 3:- Below is the desired result for the data table. Click OK for the prompt displayed, which gives details of the number of duplicates identified and the unique values remaining in the data table after deleting the duplicates.
Search Duplicate Values in Excel Using “=COUNTIF”
Consider the following table. The function =COUNTIF requires the data table range for the respective column and the criteria for the cell which you are finding the duplicates in Excel.
Step 1:- The alternative approach is to apply =COUNTIF(Column Range, Cell criteria). This function helps to identify the number of duplicates against the corresponding cells, which will enable the user to get the count of duplicates for any further analysis and findings.
Step 2:- Enter the formula and press enter, the formula must be further dragged till the end of the data table. Please remember that the data table range be must be fixed with the dollar “$” sign else the range will change to one cell down as you drag down the formula.
If the data table is very large by rows then the best way is keeping the cursor (Highlighted in red arrow) and double click on the notch at the lower right corner of the cell where the formula is applied as an alternative to dragging the formula till the end.
Below is the complete list of the count of duplicates for the total data set.
Once the formula is applied you can then apply the filter to the column header and select the count greater than 1 to view the multiple numbers of duplicates occurrence.
Things to Remember
- Use conditional formatting to find and highlight the duplicates in excel. The new rules in this selection would enable the user to identify and highlight only specific count of duplicates using COUNTIF formula.
- Remove duplicates in the DATA tab, helps you to remove any duplicates in the data table and keep only unique cell content.
- The COUNTIF formula in Excel is used to highlight the find duplicates corresponding to the cell for the respective column. This further helps to filter on any specific occurrence as per the necessity.
This has been a guide to Find for Duplicates in Excel. Here we discuss how to find, highlight, and Delete the Duplicates in excel along with examples and downloadable templates. You may also look at these useful functions in excel –