The COUNTUNIQUE function in Google Sheets is a powerful tool to count the number of unique values in a list of specified values and ranges. Whether you're analyzing survey responses, tracking customer preferences, or identifying unique items in a dataset, the COUNTUNIQUE function simplifies the task. Dive into our comprehensive guide to master its application.
Parameters
value1: The first value or range to consider for counting unique values.value2, ...: [Optional] Additional values or ranges to consider.
Step-by-Step Tutorial
-
Using
COUNTUNIQUEwith individual values:- Example:
=COUNTUNIQUE(1, 2, 3, 2, 4) - Result:
4
- Example:
-
Using
COUNTUNIQUEwith a range of cells:- Example: If
A1:A5has the values1, 2, 3, 2, 4, then=COUNTUNIQUE(A1:A5)will return4.
- Example: If
Working with a Single Value, a List, and a Range
COUNTUNIQUE accepts numbers one at a time, as a comma-separated list, or as a range — mix and match freely.
- Single value:
=COUNTUNIQUE(A1)— always returns1, since a single cell has only one value. - List of values:
=COUNTUNIQUE(A1, A2, A3)— ifA1,A2,A3are1,2,1, this returns2, since the repeated1only counts once. - Range:
=COUNTUNIQUE(A1:A10)— counts the distinct values across every cell in the range. - Mixed:
=COUNTUNIQUE(A1, A3:A6, 10)— you can combine single cells, ranges, and literal numbers in one call.
Use Cases and Scenarios
- Survey Analysis: Determine the number of unique responses to a survey question.
- Customer Segmentation: Count the number of unique customer groups based on specific characteristics.
- Data Deduplication: Identify the number of unique entries in a dataset and remove duplicates.
Related Functions
COUNT: Count the number of cells within a range that contain numbers.COUNTA: Count the number of cells within a range that are not empty.