You can use the COUNTIF function to count duplicates in Excel:
In this short post, I’ll review a simple example with the steps to count duplicates for a given dataset.
Steps to Count Duplicates in Excel using COUNTIF
Step 1: Prepare the data that contains the duplicates
To start, let’s say that you have the following dataset that contains a list of names:
As you can observe, there are duplicate names in the table. The goal is to count the number of times each name is present in the table.
Step 2: Copy the data into Excel
For simplicity, copy the above table into Excel, within the range of cells A1 to A11:
You may also add a new column called the ‘Count’ column in cell B1. You can then apply the COUNTIF function under that column to get the count of duplicates.
Step 3: Apply the COUNTIF function
Recall that the COUNTIF function has the structure of:
In the context of our example, you’ll need to apply the COUNTIF function in cell B2:
- range = A:A. It is the column where all of our values are stored (in our case it is column A)
- criteria = A2. This is the cell where we have our first value (in our case it is ‘Jon’)
The COUNTIF function will then count the number of times that ‘Jon’ appears in Column A. For our example, the name ‘Jon’ appears 3 times:
To apply the COUNTIF function across all the names, drag the function from cell B2 to cell B11. You’ll then get the count of all the duplicates:
While we used a small sample of data, the same principles that we just covered can be applied for much larger datasets.