Explanation

This example uses the UNIQUE function to extract unique values.

Since there are seven items inarray, COUNTA returns 7.

This formula is dynamic and will recalculate immediately when source data is changed.

Excel formula: Extract unique items from a list

The formula in D5 is:

Which returns the seven values seen in D5:D11.

Then COUNTA counts the zero.

This approach isexplained in more detail here.

Excel formula: Distinct values

you’re able to also filterunique values with criteria.

This alternative formula will count all values returned by UNIQUE that have a length greater than zero.

This is an example ofboolean logic.

Excel formula: Unique values ignore blanks

This formula will also exclude empty cells from results.

Dynamic source range

UNIQUE won’t automatically change the source range if data is added or deleted.

COUNTA does not count empty cells.

Excel formula: Unique values with criteria

Excel UNIQUE function

Excel COUNTA function