How to Count Each Occurrence of a Name in Excel
Question details
The user needs a formula to sequentially number repeated names in a column, returning 1 for the first occurrence, 2 for the second, and so on.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking and organizing duplicate data entries where identifying the exact sequence number of a repeated item is necessary for analysis.
- Observed behavior
- A dynamic formula is required to output the cumulative count of a specific string as the list expands downward.
Ensure your dataset is organized in a single column and identify the exact starting cell of your list to properly anchor your formula.
Use the COUNTIF Formula with an Expanding Range
The most effective way to sequentially number duplicate entries is by using the COUNTIF function with a mixed cell reference that expands as you copy it.
The COUNTIF function normally counts all instances of a value in a fixed range. By locking only the starting cell (absolute reference) and leaving the ending cell unlocked (relative reference), the range dynamically grows as you drag the formula down the column.
Click the blank cell immediately adjacent to the first name in your list. For example, if your names begin in cell B2, click on cell C2.
Type the formula =COUNTIF($B$2:B2, B2) into the formula bar and press Enter.
Select cell C2 again. Click and hold the small square at the bottom-right corner of the cell (the fill handle), and drag it down to apply the formula to the rest of the rows.

Count Name Occurrences Seamlessly in WPS Spreadsheet
WPS Spreadsheet provides robust support for logical functions like COUNTIF. You can effortlessly track duplicate values using mixed cell references, enjoying a seamless experience tailored for complex data analysis.
- 1. Open your file: Launch WPS Spreadsheet and open the document containing your list of names.
- 2. Input the formula: In an adjacent blank column, enter =COUNTIF($B$2:B2, B2) starting at the first row of your data.
- 3. Auto-fill the column: Hover over the bottom-right corner of the cell until the crosshair appears, then double-click to automatically fill the formula down the entire dataset.

Frequently Asked Questions
Why does my COUNTIF formula return the total count instead of sequential numbers?
If you see the final total count in every row, you likely locked the entire range (e.g., $B$2:$B$100). To generate sequential counts, ensure only the first cell reference is absolute ($B$2) and the second is relative (B2).
Is the COUNTIF formula case-sensitive when counting names?
No, the COUNTIF function treats uppercase and lowercase letters identically. For instance, 'Alex' and 'alex' will be counted as occurrences of the same name.
How can I count sequential occurrences based on multiple columns?
If you need to count occurrences based on multiple criteria, use the COUNTIFS function instead. You can apply the same expanding range logic, such as =COUNTIFS($B$2:B2, B2, $C$2:C2, C2).




