
When you work with large datasets in Excel, counting distinct values can be tough. Counting unique entries is key. Whether you’re analyzing customer lists, tracking inventory, or compiling reports, accuracy matters. In this guide, you’ll discover what distinct values are, why they’re important, and how to count them with different Excel functions and methods. We’ll also include real examples, use cases, and answers to frequently asked questions.
What Are Distinct Values?
Distinct values in Excel are entries that show up just once in a dataset, ignoring any duplicates. This is different from unique values, which are values that appear exactly once in the list. For example:
Value ABAC
- Distinct Values: A, B, C (3 values)
- Unique Values: B, C (2 values)
In data analytics, it’s key to know the difference between distinct and unique values. This helps ensure accurate reporting.

Why Count Distinct Values in Excel?
Counting distinct values is essential when you want:
- To avoid double-counting customers or transactions.
- A cleaner overview of data without repetition.
- To analyze the spread or variety of a dataset.
In a customer database, knowing the number of unique customers who bought your product is better than just counting total purchases. This gives better insight into your business.
How to Count Distinct Values in Excel?
Here are the top methods to count distinct values in Excel, suitable for Excel 2013 and above:
Using the UNIQUE Function (Excel 365 and Excel 2019+)
The UNIQUE function returns a list of distinct values from a range.
Formula:
=COUNTA(UNIQUE(A2:A100))
Explanation:
- A2:A100 is your data range.
- UNIQUE() filters out duplicate values.
- COUNTA() counts the number of values returned.
Best For: Fast and simple distinct count in modern Excel versions.
Using Pivot Table (Works in All Excel Versions)
Steps:
- Select your data range.
- Go to Insert > PivotTable.
- Drag the column you want to count into both “Rows” and “Values.”
- In “Values,” choose “Count.”
- This will count the distinct number of items.
To get actual distinct values:
- Click the PivotTable > Analyze > Options > Check “Add this data to the Data Model.”
- Then, in Values field settings, choose “Distinct Count.”
Best For: Users who prefer no formulas and need interactive summaries.

Using SUMPRODUCT + COUNTIF (For All Versions)
Formula:
=SUMPRODUCT(1/COUNTIF(A2:A100, A2:A100))
Explanation:
- COUNTIF() counts the frequency of each value.
- 1/COUNTIF() converts it to a fraction.
- SUMPRODUCT() sums up those fractions, giving you the number of distinct values.
Note: This method is powerful but can slow down Excel if the dataset is huge.

Using Power Query (Advanced Users)
Steps:
- Select data > Go to Data > From Table/Range.
- In Power Query, select the column.
- Click “Remove Duplicates.”
- Load the data back into Excel and use =COUNTA() to count the values.
Best For: Advanced users working with large or messy datasets.

Examples of Counting Distinct Values
Example 1: Count Distinct Product IDs
You have a list of orders with repeated product IDs. To know how many different products were ordered:
=COUNTA(UNIQUE(B2:B100))

Example 2: Count Distinct Customers per Region (Using Pivot Table)
Create a pivot table, add “Customer Name” to rows and “Region” to columns. Use distinct count on Customer Name to analyze region-wise customer spread.

Example 3: Count Distinct Words from a Text Column
Use Power Query or helper columns to split text. Then, apply the UNIQUE function to find distinct words.

Benefits of Counting Distinct Values in Excel
Accurate Data Insights
Counting unique entries helps reduce bias from repeated values. This shows the real distribution.
Better Decision Making
Knowing different customer profiles or sales types aids in targeted marketing and managing inventory.
Improved Data Cleaning
Finding and removing duplicates simplifies data maintenance and improves consistency.
Enhances Reporting
Stakeholders prefer cleaner summaries with distinct counts rather than inflated totals with duplicates.
Supports Automation
You can automate formulas like UNIQUE() and Power Query steps in workflows. This helps ensure consistent reporting.
How To Count Distinct Values In Excel
Frequently Asked Questions (FAQ’s)
What is the difference between unique and distinct values?
- Unique values appear only once.
- Distinct values are all different values regardless of their frequency.
Can I use DISTINCTCOUNT in Excel?
Yes, but only inside PivotTables with the “Add to Data Model” option selected.
What Excel version supports the UNIQUE function?
Excel 365, Excel 2019 and later support UNIQUE(). Older versions require workarounds like SUMPRODUCT.
Why is my distinct count formula showing decimals?
This usually happens with SUMPRODUCT(1/COUNTIF()). Ensure data doesn’t have blank or error values.
What is the easiest method for non-technical users?
Using PivotTables with “Distinct Count” is the easiest and most visual method.
Conclusion
Counting distinct values in Excel is a fundamental data analysis skill. Using the right Excel function can speed up your work. It also makes tasks smarter and more accurate. This applies whether you’re summarizing reports, cleaning datasets, or preparing dashboards. With Excel’s new functions like UNIQUE() and tools like Power Query, you can handle complex datasets easily. For older versions, formulas like SUMPRODUCT and PivotTables remain reliable options.
