COUNTUNIQUE Function in Google Sheets: Explained
In this article, you will learn how to use the COUNTUNIQUE formula in Google Sheets.
What does the COUNTUNIQUE formula do in Google Sheets?
This formula allows you to count the number of cells with any duplicates excluded. If there are some duplicates of a particular value in a data set, you apply this formula, and the number of the specific values is counted as one.
How to use the COUNTUNIQUE formula in Google Sheets
- Type “=COUNTUNIQUE” or go to “Insert” → “Function” (or directly navigate to the “Functions” icon) → “Math” → “COUNTUNIQUE”.
- Select a range or an array in which you want to count the number of distinctive values.
- Press the “Enter” key.
The generic syntax is as follows:
Value1: This argument should be a cell, range, or array.
Value2: If you need to select other ranges, you can add as value2, value3, ….
Note
- The COUNTUNIQUE function counts the number of unique values. So, even when a specific value appears more than once in a data set, the particular value is measured only once.
- The function does not count the number of entirely blank cells, though it counts the number of cells containing only whitespace(s).
- Ensure all values that you want to count don’t include hidden text such as “‘“ or an apostrophe. For example, if a cell input is “‘7”, it looks like “7”.
The following picture how the formula works. As you can see, while the total number of cells is eight in the chosen range, the function returns five. Why does this happen? - (i) The COUNTUNIQUE formula counts the redundant items (ones highlighted) only once for each item; and (ii) it doesn’t count the number of emply cells.
Does the COUNTUNIQUE function count blank cells?
As explained above, it does not count the number of entirely blank cells. If you need to calculate the number of empty cells, you should use the COUNTBLANK formula.