Function Problems

How to Count Values That Occur Once, Twice, or More in Excel

Khadija KhanKhadija Khan Oct 28, 2026 868 views

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.

How to Count Values That Occur Once, Twice, or More in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select an adjacent blank cell

Click on an empty cell directly next to your first data entry (for example, cell B2 next to A2).

2
Enter the COUNTIF formula

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.

3
Apply the formula to the remaining cells

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.

Use the COUNTIF Function to Calculate Occurrences
Use Absolute References: Using dollar signs ($) in the range ($A$2:$A$100) ensures the data lookup range stays locked in place when you drag the formula down to other rows.
Efficient Data Analysis

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. 1. Open your data in WPS: Launch WPS Office and open your spreadsheet file containing the dataset you need to analyze.
  2. 2. Apply COUNTIF: In an adjacent blank column, type =COUNTIF(range, criteria) and drag down to accurately count the frequency of each value.
  3. 3. Highlight duplicates visually: Select your data, go to the Home tab, click Conditional Formatting, and select Highlight Duplicates.
  4. 4. Summarize with PivotTables: Navigate to the Insert tab, click PivotTable, and drag your data fields into Rows and Values to summarize occurrence counts.
Fully compatible with Microsoft Excel (.xlsx) formats and advanced formulasPowerful PivotTable features for rapid data summarization and frequency countsBuilt-in Highlight Duplicates tool for instant visual checksFree, lightweight, and capable of handling large datasets smoothly
microsoft office alternative - wps office

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.