# Google Sheets UNIQUE Function [Ultimate Guide]

May 8, 2024

Before we start, note that the UNIQUE function works for columns, not for rows.

## UNIQUE Formula Example

Where range_to_filter is the range containing values that we want to filter using the UNIQUE function. For our first example, we want to filter a column of values to find the unique values. We will apply the UNIQUE function to the row labeled States

As the range of values under the States column is A2:A11, we will set it as the input to the function:

=UNIQUE(A2:A11)

The result is:

## UNIQUE Function Syntax

The syntax of UNIQUE function is straightforward:

## Google Sheets UNIQUE with Multiple Columns

We can apply the UNIQUE function to a range containing more than one column. The unique function will filter out duplicate rows, where all the columns in a row are similar to another row. For our first example:

We just copied the example in the previous section. We will apply the UNIQUE function to the whole range:

=UNIQUE(F2:G11)

And the result is:

This is expected, since while the first column contains duplicates, the second does not - and Google Sheets consider them unique.

Now let us modify the input a bit:

As you can see, there are some duplicates: the entry for New York, New York and Los Angeles, California. We will apply the UNIQUE function to the range:

=UNIQUE(L2:M11)

And the result is:

## Use UNIQUE with QUERY Function

It turns out you can apply the UNIQUE function to the results of the QUERY function. Specifically, you can insert the QUERY function inside the UNIQUE function. For this section, we will replicate the result of the two previous sections.

For a single column:

=unique(query(A16:B25,"select A"))

The result:

For more than one column:

=unique(query(F16:G25,"select F, G"))

The result:

We hope this article has helped you and given you a better understanding of the Google Sheets UNIQUE function. You might also like our articles on calculating time in Google Sheets and how to use ISBLANK in Google Sheets.

To optimize your workflow, we recommend reading our guide on how to extract a domain from an email.

Get Google Sheets productivity and automation tips delivered straight to your inbox