DISTINCTCOUNT

The DISTINCTCOUNT function counts the number of distinct values in a column.

Syntax

DISTINCTCOUNT(
    column
)

Parameters
  • column: Name of the column whose different values you want to count.
Returned value

The DISTINCTCOUNT function returns an integer.

Additional Information

The only allowed argument is the name of a column.

The values to be counted can be numeric or of any other type. In the case of existing Blanks, they are included in the count. If you do not want to include Blanks, use the DISTINCTCOUNTNOBLANK function.

If no values are found to count, the function returns Blank.

It should be noted that, for the calculation, the function is contextualized. In other words, it does not calculate, in the strict sense of the term, the number of different values in a column, but the number of different values in the column once the corresponding context is applied to it.

Examples

This example counts the number of different cells in a column containing numbers:

DISTINCTCOUNT function. Example of use

Note how among the 7 different values is the Blank (0, 1, 2, 3, 4, 6 and Blank).

In this second example we count the number of cells that, containing texts, are different:

DISTINCTCOUNT function. Example of use

In this example we define a custom column in which we introduce the Boolean True if the product is A, and False otherwise:

Es A = IF(Productos[Producto] = "Producto A", TRUE(), FALSE())

...and, in a new column, we count the number of different cells in the latter (in this case, Booleans):

DISTINCTCOUNT function. Example of use

Related functions
Category
Statistical
Submitted by admin on Tue, 12/04/2018 - 12:10