The COUNTUNIQUE function counts the number of unique values in a data set. This function counts duplicate values once, regardless of how often they occur. This counting results in a total that reflects every unique value as one.
Get your copy of these examples in a live Google Sheet.
ℹ️ If you need a counting method that ignores capitalization, try this technique to create a case-insensitive formula.
=COUNTUNIQUE(value1, [value2, …])
value1 – A value or range for which to count unique values
value2, … - [OPTIONAL] – Additional values or ranges for which to count unique values
COUNT – Count the numeric values in a data set
COUNTA – Count the non-blank values in a data set
COUNTIF – Count the cells that match a criterion
COUNTIFS – Count the cells that match multiple criteria
COUNTUNIQUE – Count the unique values
COUNTUNIQUEIFS – Count the unique values that meet multiple criteria
COUNTBLANK – Count the blank cells
Example 1 – List of Items
Let’s start with a list of words. The list contains several repeated words, and you only want to count each word once.
=COUNTUNIQUE(A1:A5) counts the words
Strawberry one time which results in a 3.
Example 2 – List of Numbers
Secondly, we will perform a similar count. This time with number values instead of character strings. We intend to find how many numbers are in the data set at least once.
=COUNTUNIQUE(A1:A4) counts the numbers
3 one time each which results in a 2.
Example 3 – Images
Now it’s time to have a little bit of fun! Let’s insert some images and see if Sheets knows there are only two unique images.
Well, it looks like we broke Google Sheets! There are two unique images in this list, but the function only returns 1.
Live Examples in Sheets
Go to this spreadsheet for several examples of the COUNTUNIQUE function that you can study and use anywhere you want.