In the example shown, each row in the table represents a stock trade.

On some dates, more than one trade is performed.

The goal is to count trading days the number of unique dates on which some kind of trade occurred.

Excel formula: Extract unique items from a list

The 5 dates are 1-Oct-20, 5-Oct-20, 7-Oct-20, 9-Oct-20, and 12-Oct-20.

Note: The COUNT function counts numeric values, while theCOUNTA functionwill count both numeric and text values.

Depending on the situation, it may make sense to use one or the other.

Excel formula: Count unique values with criteria

In this case, because dates are numeric, we use COUNT.

SUMPRODUCT then sums the items in the array and returns the total, 5.

This formula will calculate faster than the COUNTIF version above, but it will only work with numeric values.

Excel formula: Count unique values in a range with COUNTIF

For more details,see this article.

Numbers include negative numbers, percentages, dates, times, fractions, and formulas that return numbers.

Excel UNIQUE function

Excel COUNT function

Excel COUNTIF function

Excel SUMPRODUCT function

Article image