In this article:

Google Sheets UNIQUE Function [Ultimate Guide]

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

Original array of values.


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 applied to the first column of the array.


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:


Original array of values.


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:

UNIQUE function applied to the entire array. The UNIQUE function filters out all duplicate rows. Since there is no duplicate row, the original rows were retained.


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:

Original array of values, but has duplicate rows this time. 


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:

UNIQUE function applied to the entire array. The UNIQUE function filters out all duplicate rows, giving us a shorter list of results this time.


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:

The combination of UNIQUE and QUERY function applied to the single column of the original array. 


For more than one column:


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


The result:

The combination of UNIQUE and QUERY function applied to the single column of the original array that contains duplicate values. 


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 and trying our software for tracking bill due dates.

Automate everything you track in spreadsheets with Lido
Learn more

Level up your Google Sheets skills with our free Google Sheets automation guide

Wasting too much time doing things manually in spreadsheets? Want to spend more time doing what you love? Our 100% free, 27-page Google Sheets automation guide is full of new tips and tricks that will save you time and money!