COUNT.UNIQUE Function in Excel

The COUNT.UNIQUE function is a unique feature introduced by Modern Functions Update (MFU) that does not exist in any version of Excel. You can now run it for free on your Excel from 2007 onward, including 365 and 2024 versions.


Description

The COUNT.UNIQUE function counts the number of unique values in a specified range or array. It returns the total count of distinct values, ignoring duplicates and blank cells.

This is particularly useful for:

  • Data analysis: Count distinct customers, products, or categories
  • Inventory management: Count unique items in a stock list
  • Survey analysis: Count unique responses
  • Data cleaning: Identify how many distinct values exist in a dataset
  • Reporting: Create summary statistics for dashboards

Syntax

=COUNT.UNIQUE(array)
ArgumentDescription
arrayRequired. The range or array from which to count unique values.
count-unique-excel-function
COUNT.UNIQUE function in Excel 2007 thanks to MFU. This function is case sensitive so “a” and “A” are considered as two different values.

Important Notes

  • The function counts distinct values – duplicates are counted only once.
  • Blank cells are automatically ignored.
  • ⚠️ Important: Empty cells are not the same as cells containing a formula that returns an empty string (=""). Cells with ="" are considered as containing a value (an empty text string) and will be counted as a unique value.
  • The function is case-insensitive: “APPLE”, “Apple”, and “apple” are treated as the same value.
  • Numbers and text are treated separately: “10” (text) and 10 (number) are considered different values.
  • The function works with text, numbers, dates, and other data types.

Example Highlighting the Difference

If A1:A10 contains:

CellValue
A1Apple
A2Banana
A3Apple
A4(blank)
A5Orange
A6=””
A7Banana
A8(blank)
A9Grape
A10=””
=COUNT.UNIQUE(A1:A10)

Returns: 5 (Apple, Banana, Orange, Grape, and the empty text string "" from the formulas)

The two blank cells (A4 and A8) are ignored, but the two cells with ="" (A6 and A10) are counted as one unique value (an empty text string).

Examples

Basic Usage

If A1:A10 contains the following: “Apple”, “Banana”, “Apple”, “Orange”, “Banana”, “Apple”, “Grape”, “Orange”, “Apple”, “Apple”

=COUNT.UNIQUE(A1:A10)

Returns: 4 (Apple, Banana, Orange, Grape)

With Numbers

If A1:A10 contains: 10, 20, 10, 30, 20, 40, 50, 50, 10, 30

=COUNT.UNIQUE(A1:A10)

Returns: 5 (10, 20, 30, 40, 50)

With Mixed Data Types

If A1:A5 contains: “10” (text), 10 (number), “10”, 20, “20”

=COUNT.UNIQUE(A1:A5)

Returns: 4 (“10”, 10, 20, “20”) – note that “10” and 10 are considered different.

With Dates

If A1:A10 contains dates with duplicates:

=COUNT.UNIQUE(A1:A10)

Returns the number of distinct dates in the range.

Using a Named Range

If you have a named range called Products:

=COUNT.UNIQUE(Products)

With Dynamic Arrays

To count unique values in a dynamic array:

=COUNT.UNIQUE(UNIQUE(A1:A10))

COUNT.UNIQUE vs Other Functions

FeatureCOUNT.UNIQUEUNIQUE + COUNTACOUNTIFSUMPRODUCT
Simple syntax✅ Yes❌ Complex❌ Complex❌ Complex
Dynamic updates✅ Yes✅ Yes❌ No❌ No
Case-insensitive✅ Yes✅ Yes✅ Yes✅ Yes
Ignores blanks✅ Yes❌ No (unless filtered)❌ No❌ No
Array formula required❌ No❌ No❌ No✅ Yes

Practical Use Cases

ScenarioFormula
Count unique products=COUNT.UNIQUE(Products)
Count unique customers=COUNT.UNIQUE(CustomerID)
Count unique categories=COUNT.UNIQUE(Category)
Count distinct dates=COUNT.UNIQUE(SaleDate)
Count unique responses=COUNT.UNIQUE(SurveyResponses)
Count unique values with dynamic data=COUNT.UNIQUE(A1:A100)

Common Problems

ProblemWhat It MeansWhat To Do
#NAME? errorExcel doesn’t recognize COUNT.UNIQUEInstall Modern Functions Update
#VALUE! errorInvalid argumentEnsure the range is valid
Returns 0No values in range or all are blankCheck your data
Case-sensitive resultsData contains variationsUse UPPER or LOWER to normalize

Notes

  • ✅ Fully tested – The implementation in Modern Functions Update works reliably.
  • ✅ The function is fully compatible with Excel 2007, 2010, and all later versions.
  • ℹ️ COUNT.UNIQUE is a unique MFU feature not found in any Excel version.
  • ℹ️ The function is case-insensitive: “Apple” and “apple” are treated as the same value.
  • ℹ️ Blank cells are automatically ignored.
  • ⚠️ Cells containing ="" (formula returning an empty string) are not ignored – they are counted as a unique empty text value.
  • ℹ️ Text and numbers are treated differently: “10” (text) and 10 (number) are distinct.
  • ⚠️ The function works with a single array argument only.

See Also

Modern Function Update: List of new functions

Leave a comment