The COUNTUNIQUE function counts the number of unique values in a data set. This function counts duplicate values once regardless of how many times 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.
=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
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. Our intention is to find how many numbers are in the data set at least once.
=COUNTUNIQUE(A1:A4) counts the numbers
3 one time 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 is only returning 1.
Live Examples in Sheets
Go to this spreadsheet for several examples of the COUNTUNIQUE function that you can study and use anywhere you would like.