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.
Note: This tutorial on how to find duplicates in Excel is suitable for Excel 2007, Excel 2010, Excel 2013, Excel 2013, Excel 2019 and Office 365 users.
Duplicate rows of data in a spreadsheet are every Excel user’s cause for a headache. They are annoying to deal with and eat a lot of time while cleaning up.
You might have come across some guides bombarding you with complicated formulas to deal with duplicate rows.
Related:
Excel Goal Seek—the Easiest Guide (3 Examples)
Create A Pivot Table In Excel—the Easiest Guide
Excel Conditional Formatting -the Best Guide (Bonus Video)
Don’t fret. I have created this easy guide on how to find duplicates in Excel, making it a walk in the park for you.
By the end of this guide, you’ll be able to find, highlight, count, filter, and remove duplicates in Excel instantly.
In this article we’ll cover:
- Find Duplicates in Excel Using Conditional Formatting
- How to Highlight Duplicates in Excel?
- How to Find Duplicate Cells with the Exact Number of Occurrences?
- How to Find Duplicate Rows in Excel?
- How to Remove Duplicate Rows in Excel?
- How to Use COUNTIF / COUNTIFS to Find Duplicates in Excel?
- How to Find Duplicates in Excel Using COUNTIF?
- How to Find Case Sensitive Duplicates?
- How to Find Duplicate Rows in Excel Using COUNTIFS?
- How to Count Duplicates in Excel Using COUNTIF?
- How to Count the Number of Duplicate Rows in Excel Using COUNTIFS?
- How to Filter Duplicates in Excel?
Find Duplicates in Excel Using Conditional Formatting
Conditional formatting is one of the quickest ways to find duplicates in Excel. It is a straightforward tool for highlighting duplicate values or duplicate rows in a sheet.
But, it’ll only work properly when you keep some important things in mind. We’ll cover these with the help of the following examples.
How to Highlight Duplicates in Excel?
Let’s look at how to accomplish this with the help of these simple steps.
- Get your Data ready as show below. I recommend you create named ranges for your columns, but it is not necessary.
- Select your Data and click on the Conditional Formatting button under the Home Ribbon
- Under Highlight Cell Rules, click on Duplicate Values.
- Choose your preferred Format option or create a custom format.
- Click OK
- You have successfully highlighted duplicates in Excel.
Notice that doing this will highlight all instances of recurrence in the data range.
Also Read:
The Best Excel Project Management Template In 2021
How To Use Excel Countifs: The Best Guide
Excel Sumifs & Sumif Functions – The No.1 Complete Guide
How to Find Duplicate Cells with the Exact Number of Occurrences?
Sometimes, you may want to find and highlight cells that repeat only a certain number of times.
For such cases, follow these steps.
- Clear any existing conditional formatting in your data.
- Under conditional formatting, locate and click on the New Rule option.
- In the next window, under the rule type, select the Use a formula to determine which cells to format option.
- In this example, Under “Format Values where this formula is true” I enter =COUNTIF($A$1:$C$13,A1)=2, since my data spans from cell A1 to cells C13.
In our case, we want to find the number of cells that repeat only two times. Hence, the “=2” at the end of the formula.
You can use any number or logical operator (<,>, etc) here that you prefer. In this case, the COUNTIF formula returns the number of occurrences where a cell repeats in the data range A1:C13. If the value is equal to two, conditional formatting is applied.
- Choose your preferred Formatting style and Click OK.
How to Find Duplicate Rows in Excel?
Sometimes, you may want to find and highlight duplicate rows of data instead of just cells. I’ll show you a foolproof method to implement this in Excel. Follow these steps.
- Select the Data Range that contains the duplicate rows.
- Clear any existing conditional formatting in your data.
- Under Conditional Formatting, locate and click on the New Rule option.
- In the next window, under the Rule Type select the Use a formula to determine which cells to format option.
- Under “Format Values where this formula is true” I enter =COUNTIFS($A$1:$A$13,$A1,$B$1:$B$13,$B1,$C$1:$C$13,$C1)>1
The COUNTIFS formula checks every column simultaneously for cases where all these duplicate cells repeat in the same row. That is it checks for duplicate rows. Change A1:A13, B1:B13, C1:C13 suitably as per your data range.
- Choose your preferred Formatting Style and Click OK.
How to Remove Duplicate Rows in Excel?
In some cases, just highlighting duplicate rows is not enough. You also need to delete them.
Follow these steps to easily remove duplicate rows.
- Get your data ready
- Locate the Data Tools section under the Data Tab of your Excel Sheet
- Under Data Tools, click on the Remove Duplicates button.
4. Select all the columns for deleting duplicate rows and Click OK. Voila! Excel removes all duplicate rows in just a click.
How to Use COUNTIF / COUNTIFS to Find Duplicates in Excel?
When it comes to handling duplicates, there cannot be a more robust and suitable formula than COUNTIFS. It can be used for granular level actions like finding duplicates excluding the first instance, finding case sensitive duplicates, counting the number of duplicates until each row, etc. I’ll show you how to do all of this with the help of examples.
How to Find Duplicates in Excel Using COUNTIF?
To find duplicates using COUNTIF, follow these steps.
Let’s assume I have the column “A” full of repetitive data and I need to identify these duplicates using the COUNTIF formula.
How to Find Duplicates Including the First Instance?
- Get your Data ready
- In the ‘B2’ cell, i.e right next to column “A”, type in
= IF(COUNTIF($A$2:$A$13,A2)>1,”Yes”,””)
Here, the COUNTIF function compares each cell in the range A2:A13 for duplicates and returns the total number of repetitions for each case. The “IF” function then checks if the number of repetitions is greater than one. If it is greater than one, it is a duplicate, else, not a duplicate.
- Drag this formula to the end of the data range using the fill handle.
- All your duplicate cells are now marked with “YES”
Did you notice that it is marking even the first instances of data as duplicates?
Sometimes this is not required, especially if you are planning to delete or filter the data later. To avoid this from happening, follow the steps below.
How to Find Duplicates Excluding the First Instance?
I am working with the same set of Data in Column “A”
- Get your Data ready.
- In the ‘B2’ cell, i.e right next to column “A”, type in =IF(COUNTIF($A$2:$A2,A2)>1,”Yes”,””)
Here, the COUNTIF function searches each Cell in the Data Range of Column “A” for duplicates. It then returns the number of repetitions until that particular row. The IF function then compares if the number of repetitions is greater than one, in order to mark as duplicates. Hence, the first instance of any duplicate will return a value of 1 and the first instance will not be marked as a duplicate.
- Drag the formula to the end of the Data range using the fill handle.
- All your duplicates except the first one are marked with “YES”.
How to Find Case Sensitive Duplicates?
All the above methods consider data with different text-cases as the same and count them as duplicates.
But, sometimes, you may want to find an exactly matching duplicate. To accomplish this, follow these simple steps.
- Get your data ready
- In the ‘B2’ cell, i.e right next to column “A”, type in =IF(SUM((–EXACT($A$2:$A$13,A2)))<=1,””,”Yes”)
Here, the “EXACT” function searches for exact matches to return either 1 or 0. The SUM function returns the total number of exact duplicates. If it is greater than 1, the cell is marked as a duplicate.
- Drag the formula to the end of the Data range using the fill handle.
- All your case sensitive duplicates are marked with “Yes”.
How to Find Duplicate Rows in Excel Using COUNTIFS?
Now, let’s see how to easily find duplicate rows in your sheet using the COUNTIFS functions.
If you want to include the first instance, just follow these simple steps.
- Get your Data ready. I am using a sheet that contains three columns of data.
- In ‘D2’ cell, i.e right next to the Data enter =IF(COUNTIFS($A$2:$A$13,A2,$B$2:$B$13,B2,$C$2:$C$13,C2)>1, “Yes”, “”)
This is exactly the same as the COUNTIF function, except here it checks all the columns simultaneously for duplicates. Hence, it can find all duplicate rows easily.
- Drag the formula to the end of the data range using the fill handle.
- All your duplicate rows including the first instances are marked with “Yes”
If you want to exclude the first instance, just follow these simple steps
- Get your Data ready, I am using the same Sheet here.
- In ‘D2’ cell, i.e right next to the Data enter =IF(COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2,$C$2:$C2,$C2)>1, “Yes”, “”)
Here, the COUNTIFS function compares each row in the data range for duplicates and returns the number of repetitions until that particular row.
The IF function then compares if the number of repetitions is greater than one to mark as duplicates. The first instance of any duplicate will return a value of 1. Hence, the first instance will not be marked as a duplicate
- Drag the formula to the end of the Data range using the fill handle.
- All your duplicate rows excluding the first instances are marked with “Yes”
How to Count Duplicates in Excel Using COUNTIF?
There may be situations where you need to find the number of duplicates in your Data.
Let’s see how to tackle it easily.
How to Count Duplicates for Each Cell?
To count the number of duplicates for each cell just follow these steps.
- Get your Data ready.
- In ‘B2’ Cell, enter =COUNTIF($A$2:$A$13,A2)
The COUNTIF function simply counts and returns the number of times a single data value gets repeated in the Range A2:A13.
- Drag the formula to the end of the data range using the fill handle.
- All your duplicate data have a corresponding cell that displays their number of occurrences.
How to Count Duplicates for Each Cell Until Each Row?
To count the number of repeats for each cell until each row, follow these steps.
- Get your Data ready
- In ‘B2’ Cell, enter =COUNTIF($A$2:$A$13,A2)
Here, the COUNTIF function searches each Cell in the Data Range of Column “A” for duplicates. It then returns the number of repetitions until that particular row. Hence, we get the number of instances until each row.
- Drag the formula to the end of the data range using the fill handle.
- Each duplicate data has a corresponding cell that displays their number of instances until that row.
How to Count the Number of Duplicate Rows in Excel Using COUNTIFS?
You can use the same methods to find the number of occurrences for duplicate rows. Just use the COUNTIFS functions in the place of the COUNTIF function.
For example, in the following case I enter =COUNTIFS($A$2:$A$13,A2,$B$2:$B$13,B2,$C$2:$C$13,C2) in the “D2” cell to get the desired result
How to Filter Duplicates in Excel?
Finally, you may want to filter all duplicates found in your Sheet. This is a very useful feature that will come in handy if you want to further delete, move or copy these duplicates.
Let’s see how to do this easily. Just follow these steps.
- Select the Data where you already have found the duplicates using the COUNTIFS formula.
- Under the Data Tab, locate and click on the Filter button.
- Now, click on the arrow on the “Repeat” column header and check only “Yes” to show only the duplicates.
- You can also uncheck “Yes” to hide all duplicates.
Do anything as you please with these filtered duplicate rows of data. You can remove, copy to another sheet, or simply hide them.
Suggested Reads:
How To Protect Cells In Excel Workbooks-the Easiest Way
Create An Excel Dashboard In 5 Minutes – The Best Guide
Dynamic Dropdown Lists In Excel – Top Data Validation Guide
FAQs
What is the easiest way to count duplicates in Excel?
The easiest way to count duplicates is to use the COUNTIF function if you already know the value you are looking for.
Just type COUNTIF(X:X, X1) where ‘X’ is the column you want to search and ‘X1’ is the value you are counting for.
How do you find duplicates in Excel and group them together?
The easiest way to group duplicates together in Excel is to highlight them using conditional formatting. Then go to the SORT option under the DATA tab and under the drop-down options click “Cell Colour”. All your highlighted duplicates are grouped together now.
Closing Thoughts
We are at the end of this guide on how to find duplicates in Excel. I have covered almost all important user-friendly ways to find duplicates in Excel. All of these methods will come in handy and will suffice for most users.
If you need more high-quality guides on Excel functions and features check out our free Excel resources section.
If you are interested in gaining in-depth knowledge and practice in Excel try our Excel Courses here.
Adam Lacey
Adam Lacey is an Excel enthusiast and online learning expert. He combines these two passions at Simon Sez IT where he wears a number of different hats.When Adam isn’t fretting about site traffic or Pivot Tables, you’ll find him on the tennis court or in the kitchen cooking up a storm.
Download Article
Download Article
When working with a Microsoft Excel spreadsheet with lots of data, you’ll probably encounter duplicate entries. Microsoft Excel’s Conditional Formatting feature shows you exactly where duplicates are, while the Remove Duplicates feature will delete them for you. Viewing and deleting duplicates ensures that your data and presentation are as accurate as possible.
-
1
Open your original file. The first thing you’ll need to do is select all data you wish to examine for duplicates.
-
2
Click the cell in the upper left-hand corner of your data group. This begins the selecting process.
Advertisement
-
3
Hold down the ⇧ Shift key and click the final cell. Note that the final cell should be in the lower right-hand corner of your data group. This will select all of your data.
- You can do this in any order (e.g., click the lower right-hand box first, then highlight from there).
-
4
Click on «Conditional Formatting.« It can be found in the «Home» tab/ribbon of the toolbar (in many cases, under the «Styles» section).[1]
Clicking it will prompt a drop-down menu. -
5
Select «Highlight Cells Rules,» then «Duplicate Values.« Make sure your data is still highlighted when you do this. This will open a window with customization options in another drop-down menu.[2]
-
6
Select «Duplicate Values» from the drop-down menu.
- If you instead wish to display all unique values, you can select «Unique» instead.
-
7
Choose your highlight color. The highlight color will designate duplicates. The default is light red with dark red text.[3]
-
8
Click «OK» to view your results.
-
9
Select a duplicate’s box and press Delete to delete it. You won’t want to delete these values if each piece of data represents something (e.g., a survey).
- Once you delete a one-time duplicate, its partner value will lose its highlight.
-
10
Click on «Conditional Formatting» again. Whether you deleted your duplicates or not, you should remove the highlight formatting before exiting the document.
-
11
Select «Clear Rules,» then «Clear Rules from Entire Sheet» to clear formatting. This will remove the highlighting around any duplicates you didn’t delete.[4]
- If you have multiple sections of your spreadsheet formatted, you can select a specific area and click «Clear Rules from Selected Cells» to remove their highlighting.
-
12
Save your document’s changes. If you’re satisfied with your revisions, you have successfully found and deleted duplicates in Excel!
Advertisement
-
1
Open your original file. The first thing you’ll need to do is select all data you wish to examine for duplicates.
-
2
Click the cell in the upper left-hand corner of your data group. This begins the selecting process.
-
3
Hold down the ⇧ Shift key and click the final cell. The final cell is in the lower right-hand corner of your data group. This will select all of your data.
- You can do this in any order (e.g., click the lower right-hand box first, then highlight from there).
-
4
Click on the «Data» tab in the top section of the screen.
-
5
Find the «Data Tools» section of the toolbar. This section includes tools to manipulate your selected data, including the «Remove Duplicates» feature.
-
6
Click «Remove Duplicates.« This will bring up a customization window.
-
7
Click «Select All.« This will verify all of your columns have been selected.[5]
-
8
Check any columns you wish to use this tool on. The default setting has all columns checked.
-
9
Click the «My data has headers» option, if applicable. This will prompt the program to label the first entry in each column as a header, leaving them out of the deletion process.
-
10
Click «OK» to remove duplicates. When you are satisfied with your options, click «OK». This will automatically remove any duplicate values from your selection.
- If the program tells you that there aren’t any duplicates—especially if you know there are—try placing a check next to individual columns in the «Remove Duplicates» window. Scanning each column one at a time will resolve any errors here.
-
11
Save your document’s changes. If you’re satisfied with your revisions, you have successfully deleted duplicates in Excel!
Advertisement
Add New Question
-
Question
How do I get rid of colored highlighted areas in Excel?
Press Ctrl-H, click Options, and then click the top Format button to search for colored cells (using the Fill tab). Leave the «Replace with» field blank to delete the contents of cells with the format you specified.
-
Question
How can I tell if a motherboard or hard drive is bad in a PC?
Faulty hard drives will often have data that is said to be corrupted. Motherboards that are faulty result in hardware orientated failures.
-
Question
Can this method be used to find duplicates between several different sheets? If not, what method can I use to do that?
Kadriguler
Community Answer
The repeating data with count of repetitions can be found easily with Excel Vba.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
wikiHow Video: How to Find Duplicates in Excel
-
You can also identify duplicate values by installing a third-party add-in utility. Some of these utilities enhance Excel’s conditional formatting feature to enable you to use multiple colors to identify duplicate values.
-
Deleting your duplicates comes in handy when reviewing attendance lists, address directories, or similar documents.
Thanks for submitting a tip for review!
Advertisement
-
Always save your work when you’re done!
Advertisement
References
About This Article
Article SummaryX
To view duplicate cells in your worksheet, start by highlighting the column or row you want to check. Click the Home tab, and then click the Conditional Formatting button in the «Styles» area of the toolbar. Select Highlight Cells Rules on the menu, and then Duplicate Values. Now, choose how you’d like Excel to highlight the duplicates in your data, such as in Light Red Fill with Dark Red Text or with a Red Border. Click OK to see your highlighted duplicates. When you’re finished, clear the special formatting by clicking the Conditional Formatting button and selecting Clear Rules and then Clear Rules from Entire Sheet. If you want to delete duplicates without viewing them first, select the cells you want to check, and then click the Data tab at the top. In the «Data Tool» area of the toolbar, click Remove Duplicates. Click the Select All button at the top-left corner of the window to select all columns, or just select the ones you want to check. Check the box to «My data has headers» if your column has a title cell at the top, and then click OK to remove duplicate cells from the selected area.
Did this summary help you?
Thanks to all authors for creating a page that has been read 1,808,322 times.
Reader Success Stories
-
Anna Krieger
Nov 30, 2016
«Thanks a lot for the functions, makes life much easier when getting a list of 1600 items and having to find whether…» more
Is this article up to date?
Duplicate Values | Triplicates | Duplicate Rows
This example teaches you how to find duplicate values (or triplicates) and how to find duplicate rows in Excel.
Duplicate Values
To find and highlight duplicate values in Excel, execute the following steps.
1. Select the range A1:C10.
2. On the Home tab, in the Styles group, click Conditional Formatting.
3. Click Highlight Cells Rules, Duplicate Values.
4. Select a formatting style and click OK.
Result. Excel highlights the duplicate names.
Note: select Unique from the first drop-down list to highlight the unique names.
Triplicates
By default, Excel highlights duplicates (Juliet, Delta), triplicates (Sierra), etc. (see previous image). Execute the following steps to highlight triplicates only.
1. First, clear the previous conditional formatting rule.
2. Select the range A1:C10.
3. On the Home tab, in the Styles group, click Conditional Formatting.
4. Click New Rule.
5. Select ‘Use a formula to determine which cells to format’.
6. Enter the formula =COUNTIF($A$1:$C$10,A1)=3
7. Select a formatting style and click OK.
Result. Excel highlights the triplicate names.
Explanation: =COUNTIF($A$1:$C$10,A1) counts the number of names in the range A1:C10 that are equal to the name in cell A1. If COUNTIF($A$1:$C$10,A1) = 3, Excel formats cell A1. Always write the formula for the upper-left cell in the selected range (A1:C10). Excel automatically copies the formula to the other cells. Thus, cell A2 contains the formula =COUNTIF($A$1:$C$10,A2)=3, cell A3 =COUNTIF($A$1:$C$10,A3)=3, etc. Notice how we created an absolute reference ($A$1:$C$10) to fix this reference.
Note: you can use any formula you like. For example, use this formula =COUNTIF($A$1:$C$10,A1)>3 to highlight names that occur more than 3 times.
Duplicate Rows
To find and highlight duplicate rows in Excel, use COUNTIFS (with the letter S at the end) instead of COUNTIF.
1. Select the range A1:C10.
2. On the Home tab, in the Styles group, click Conditional Formatting.
3. Click New Rule.
4. Select ‘Use a formula to determine which cells to format’.
5. Enter the formula =COUNTIFS(Animals,$A1,Continents,$B1,Countries,$C1)>1
6. Select a formatting style and click OK.
Note: the named range Animals refers to the range A1:A10, the named range Continents refers to the range B1:B10 and the named range Countries refers to the range C1:C10. =COUNTIFS(Animals,$A1,Continents,$B1,Countries,$C1) counts the number of rows based on multiple criteria (Leopard, Africa, Zambia).
Result. Excel highlights the duplicate rows.
Explanation: if COUNTIFS(Animals,$A1,Continents,$B1,Countries,$C1) > 1, in other words, if there are multiple (Leopard, Africa, Zambia) rows, Excel formats cell A1. Always write the formula for the upper-left cell in the selected range (A1:C10). Excel automatically copies the formula to the other cells. We fixed the reference to each column by placing a $ symbol in front of the column letter ($A1, $B1 and $C1). As a result, cell A1, B1 and C1 contain the same formula, cell A2, B2 and C2 contain the formula =COUNTIFS(Animals,$A2,Continents,$B2,Countries,$C2)>1, etc.
7. Finally, you can use the Remove Duplicates tool in Excel to quickly remove duplicate rows. On the Data tab, in the Data Tools group, click Remove Duplicates.
In the example below, Excel removes all identical rows (blue) except for the first identical row found (yellow).
Note: visit our page about removing duplicates to learn more about this great Excel tool.
In MS Excel, the duplicate values can be found and removed from a data set. Depending on your data and requirement, the most commonly used methods are the conditional formatting feature or the COUNTIF formula to find and highlight the duplicates for a specific number of occurences. The columns of the data set can be then filtered to view the duplicate values.
In this article, we will look at 5 different methods to check, identify, and delete duplicates in Excel.
Table of contents
- How to Find Duplicates in Excel?
- 5 Methods to Check & Identify Duplicates in Excel
- #1 – Conditional Formatting
- #2 – Conditional Formatting (Specific Occurrence)
- #3 – Change Rules (Formulas)
- #4 – Remove Duplicates
- #5 – COUNTIF Formula
- Frequently Asked Questions
- Recommended Articles
- 5 Methods to Check & Identify Duplicates in Excel
5 Methods to Check & Identify Duplicates in Excel
You can download this Find for Duplicates Excel Template here – Find for Duplicates Excel Template
#1 – Conditional Formatting
The conditional formattingConditional formatting is a technique in Excel that allows us to format cells in a worksheet based on certain conditions. It can be found in the styles section of the Home tab.read more feature is available in Excel 2007 and subsequent versions.
The following table consists of the expenses incurred on availing certain office facilities. The corresponding dates of purchasing such facility are also listed.
We want to identify the duplicates in excel with the help of conditional formatting.
The steps to find the duplicates in excel with the help of conditional formatting are listed as follows:
- Select the data range (A1:C13) where duplicates are to be found.
- In the Home tab, select “conditional formatting” from the “styles” section. From the drop-down menu, select “highlight cell rules” and click on “duplicate values.”
- The pop-up window titled “duplicate values” appears. In the first box on the left side, select “duplicate.” In the “values with” drop-down, select the required color to highlight the duplicate cells. Click “Ok.”
- The duplicate cells are highlighted in the data table, as shown in the following image.
- The columns can be filtered to identify the duplicate values. For this, right-click the required column and select “filter by selected cell’s color.” The data is filtered for duplicates.
- The result after applying the filter to the first column (office supplies) is shown in the following image.
#2 – Conditional Formatting (Specific Occurrence)
Let us consider an example to identify the specific number of duplications. In the following table, we want to check and show the duplicate values with three occurrences.
The steps to find the duplicate values for specific number of occurrences are listed as follows:
Step 1: Select the range A2:C8 in the given data table.
Step 2: In the Home tab, select “conditional formatting” from the “styles” section. Click “new rule.”
Note: The “new rule” option helps highlight a specific count of duplicates using the COUNTIF formula.
Step 3: The pop-up window titled “new formatting rule” appears. Enter the following details, as shown in the succeeding image.
- Under “select a rule type,” select “use a formula to determine which cells to format.”
- Under “edit the rule description,” enter the COUNTIFThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump”
read more formula.
The COUNTIF formula “=COUNTIF(cell range of the data table, cell criteria)” finds and highlights the cells for the desired number of occurrences.
In this case, the COUNTIF formula highlights duplicate cells having triplicate count. This count can be changed to a greater number. The conditions can also be changed depending on the user’s requirement.
Step 4: Once the COUNTIF formula is entered, click “format.” The pop-up window titled “format cells” opens. Select the font style “regular.”
Step 5: In the “fill” tab, select blue color. The “fill” tab helps highlight the duplicate cellsHighlight Cells Rule, which is available under Conditional Formatting under the Home menu tab, can be used to highlight duplicate values in the selected dataset, whether it is a column or row of a table.read more.
Step 6: Once the selections in “format cells” window are complete, click “Ok.” Click “Ok” again in the “new formatting rule” window.
Step 7: The result is displayed in the following image. The duplicate cells with three occurrences are highlighted.
#3 – Change Rules (Formulas)
Working on the data of example #2, let us understand the procedure of changing the formula. For applying new formulas, the existing rules (formulas) of the data tableA data table in excel is a type of what-if analysis tool that allows you to compare variables and see how they impact the result and overall data. It can be found under the data tab in the what-if analysis section.read more have to be cleared.
The steps to clear the existing rules (shown in the succeeding image) are listed as follows:
Step 1: In the Home tab, select “conditional formatting” from the “styles” section.
Step 2: In “clear rules” option, select either of the following:
- Clear rules from selected cells–This resets the rules for the selected range of the table. So, prior to clearing the rules, the data needs to be selected.
- Clear rules from entire sheet–This clears the rules for the entire sheet.
The blue highlighted cells disappear and the original table is displayed.
#4 – Remove Duplicates
Let us check and delete duplicate values from a selected range. Prior to deletion, keeping a copy of the table is advisable because the duplicates will be permanently deleted.
The following table displays a series of items with their corresponding IDs.
The steps to find and delete duplicate values are listed as follows:
Step 1: Select the range of the table whose duplicates are required to be deleted.
Step 2: In the Data tab, select “remove duplicates” from the “data tools” section.
Note: The “remove duplicates” option helps eliminate duplicates and retain unique cell values.
Step 3: The pop-up window titled “remove duplicates” appears, as shown in the succeeding image. By default, the following options are already selected:
- The checkboxes for both the headers (“order ID” and “items”)
- The “select all” box
Since the table consists of column headers, select the checkbox “my data has headers.” Click “Ok” to execute.
Note: To change the number of columns selected, click “unselect all.” Following this, the desired columns from which the duplicates are to be deleted can be selected.
Step 4: The result is shown in the succeeding image. A prompt is displayed which states the following details:
- The number of duplicate values removed from the table
- The number of unique values that remain in the table after deletion
Click “Ok.” Hence, the duplicate values along with their corresponding rows are deleted.
#5 – COUNTIF Formula
The following table displays the names of a few countries. We want to identify the duplicate values using the COUNTIF function.
The COUNTIF function requires the range (column containing duplicate entries) and the cell criteria. It returns the number of corresponding duplicates for every cell.
The steps to find the duplicate values in excel with the help of the COUNTIF function are listed as follows:
Step 1: Enter the formula shown in the succeeding image. Press the “Enter” key.
Note: The range must be fixed with the dollar ($) sign. Otherwise, the cell reference will change on dragging the formula.
Step 2: Drag the formula till the end of the table with the help of the fill handle. Alternatively, place the cursor on cell B2 and double-click the fill handle. The fill handle appears at the lower right corner of cell B2.
Step 3: The output of the formula is shown in the following image. It returns the count of duplicates for the entire data set.
Note: The filter can be applied to the column header to view the occurrences greater than one.
Frequently Asked Questions
1. What does it mean to find duplicates in Excel?
While consolidating different worksheets, several duplicates may be found in a data set. MS Excel helps to find and highlight such duplicates. It is also possible to filter a column for duplicate values.
An easy way to search for duplicates is by using the COUNTIF formula. This formula can count the total number of duplicates in a column. It can also count the number of individual instances of a particular duplicate entry. It accepts two arguments–the range and the criteria.
2. How to find duplicates in a column of Excel?
To check a column for duplicates, the formula is given as follows:
“=COUNTIF(A:A,A2)>1”
The formula checks for duplicates in column A. The topmost cell is A2. For every duplicate value, the formula returns “true.” For every unique value, the formula returns “false.”
Note: For an output other than “true” and “false,” the COUNTIF formula can be enclosed in the IF function.
3. What is the formula to find duplicates in Excel?
The generic formula to find the exact, case-sensitive duplicate values is stated as follows:
“IF(SUM((-EXACT(range,uppermost_cell)))<=1,””,”Duplicate”)”
The EXACT function compares the cell range with the target cell. The SUM function adds the number of instances. If the occurrence is greater than 1, the IF function returns “duplicate.”
Note 1: Since it is an array formula, it should be entered using “Ctrl+Shift+Enter.”
Note 2: If the same word appears twice in lowercase and once in uppercase, the formula will not count the uppercase word as duplicate.
Recommended Articles
This has been a guide to Find Duplicates in Excel. Here we discuss how to identify, check and show duplicates in excel with examples. You may also look at these useful functions in Excel –
- How to Use IF Formula in Excel (with Examples)?
- Conditional Formatting for Blank Cells | Steps
- Create a Dashboard in Excel
- Apply Conditional Formatting in Pivot Table