How to Count Values That Occur Once, Twice, or More in Excel
Question details
The user needs to determine the frequency of data values in a given range, specifically counting how many items appear exactly once, twice, or multiple times.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing a dataset to find unique items, duplicates, or specific item frequencies within a list.
- Observed behavior
- The user needs a method to group, highlight, or count spreadsheet entries based on their occurrence rate to better understand data distribution.
Ensure your dataset does not contain unintended blank spaces or hidden characters, as these can cause Excel to miscount seemingly identical values. It is highly recommended to use the TRIM function or sort your data first for easier verification.
Use the COUNTIF Function to Calculate Occurrences
The COUNTIF function is the most precise way to calculate exactly how many times each specific value appears within your dataset.
By setting up a simple COUNTIF formula adjacent to your data, you can generate a frequency column that dynamically updates if your data changes.
Click on an empty cell directly next to your first data entry (for example, cell B2 next to A2).
Type the formula =COUNTIF($A$2:$A$100, A2) where $A$2:$A$100 is your absolute data range and A2 is the cell you are checking.
Press Enter to generate the count for the first row. Then, click and drag the fill handle (the small square at the bottom right of the cell) down to apply this formula to the rest of your data. The resulting numbers will indicate exactly how many times each value appears.

Highlight Duplicate Values Using Conditional Formatting
If you only need a visual cue to identify values that appear more than once, Conditional Formatting is the fastest method.
Create a PivotTable to Group Values by Occurrence Count
A PivotTable provides a clean, aggregated summary showing exactly how many times each unique value appears without adding new formulas to your raw data.
Count and Analyze Data Easily in WPS Spreadsheet
WPS Spreadsheet provides powerful, user-friendly data analysis tools that are fully compatible with Microsoft Excel. You can quickly use COUNTIF, Conditional Formatting, and PivotTables to count value occurrences, find duplicates, and organize your datasets seamlessly.
- 1. Open your data in WPS: Launch WPS Office and open your spreadsheet file containing the dataset you need to analyze.
- 2. Apply COUNTIF: In an adjacent blank column, type =COUNTIF(range, criteria) and drag down to accurately count the frequency of each value.
- 3. Highlight duplicates visually: Select your data, go to the Home tab, click Conditional Formatting, and select Highlight Duplicates.
- 4. Summarize with PivotTables: Navigate to the Insert tab, click PivotTable, and drag your data fields into Rows and Values to summarize occurrence counts.

Frequently Asked Questions
How do I count only the unique values that appear exactly once in Excel?
You can use the formula =SUMPRODUCT((COUNTIF(A2:A100, A2:A100)=1)*1) to count the total number of items in the range A2:A100 that occur exactly one time.
Can I count how many values appear exactly twice?
Yes. The easiest method is to use COUNTIF to find the frequencies in a helper column first, and then use a second COUNTIF formula on that helper column to count how many '2's exist. Alternatively, you can use the array formula =SUM(IF(COUNTIF(A2:A100, A2:A100)=2, 1, 0))/2.
Why is my COUNTIF formula returning incorrect occurrence counts?
Incorrect counts usually happen due to trailing spaces, hidden non-breaking spaces, or text formatting inconsistencies. Use the TRIM function on your data first to clean up excess spaces before applying the COUNTIF formula.
Does Conditional Formatting count the occurrences for me?
No, Conditional Formatting only applies visual formatting (such as cell background colors) to values that appear more than once. To get the actual numerical count of how many times a value appears, you must use the COUNTIF function or a PivotTable.




