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 repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started