How to Count How Many Times Each Name Appears in Excel
Question details
The user needs a formula to determine how many times specific individual names appear within a given Excel dataset.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing a list of data to find the exact frequency of occurrences for each unique name in a specific range.
- Observed behavior
- A summarized list showing each unique name alongside its total count of appearances is generated.
Ensure your dataset does not contain trailing spaces or inconsistent formatting, as Excel treats 'John' and 'John ' as two completely different names.
Use the COUNTIF Function with a Unique List
The most straightforward and reliable method for counting specific items is to use the COUNTIF function alongside a column of unique names.
The COUNTIF function requires two arguments: the range of your entire data, and the specific criteria (the name) you want to count. Generating a unique list of names first makes this process much faster.
Place or extract your unique list of names into a separate column (e.g., Column B). You can copy the original list and use Data > Remove Duplicates to create this.
In the adjacent cell (e.g., C2), enter the formula =COUNTIF(A:A, B2), assuming your raw name data is located in Column A.
Select cell C2 and drag the fill handle down to apply the counting formula to all the unique names in Column B.

Create a Dynamic Search with the FILTER Function
If you want to look up names interactively one by one, combining a drop-down list with the FILTER function provides a clean dashboard experience.
Count Data Easily with WPS Spreadsheet
WPS Office provides a highly capable spreadsheet application that supports all standard Excel functions, including COUNTIF, UNIQUE, and FILTER. You can effortlessly manage and analyze your datasets without changing your regular workflow.
- 1. Open your data file: Launch WPS Spreadsheet and open your .xlsx file containing the raw list of names.
- 2. Apply the COUNTIF formula: Select an empty cell right next to your target name and type =COUNTIF(A:A, B2).
- 3. Fill the series: Press Enter, then drag the bottom-right fill handle downwards to calculate the frequencies for all names simultaneously.

Frequently Asked Questions
Why is COUNTIF returning 0 for a name that exists in my list?
This usually happens due to hidden characters or trailing spaces. Use the TRIM function on your data range (e.g., =TRIM(A2)) to clean the text formatting before using COUNTIF.
How do I count names that are case-sensitive?
The standard COUNTIF function is not case-sensitive. To count strictly matching cases, you need to use the SUMPRODUCT and EXACT functions together, like this: =SUMPRODUCT(--EXACT(B2, A:A)).
Can I count how many different (unique) names there are in total?
Yes. In modern spreadsheet versions, you can combine functions by typing =COUNTA(UNIQUE(A2:A100)) to find the total number of distinct names present in your dataset.




