HomeGoogle DocsSpreadsheetFilter Unique Values Using the Filter Menu in Google Sheets

Filter Unique Values Using the Filter Menu in Google Sheets

Published on

Can I filter unique values/rows/records using the Filter Menu in Google Sheets? Is it possible?

Yes! you can filter unique values using the Filter menu in Google Sheets. Utilize a custom formula in the Filter menu’s custom formula field, similar to how you use custom formulas in conditional formatting.

When you filter your data using the Filter menu command interface, it offers several advantages. One of the foremost benefits is filtering your data at the source, allowing direct editing of the filtered data.

Besides the Filter menu, Google Sheets provides functions like FILTER and QUERY for conditional data filtering. However, these functions don’t enable filtering data at its source; they filter data into a new range or sheet.

It’s important to note that these functions lack parameters for making the data unique. You may consider using UNIQUE or SORTN in conjunction with these functions to achieve uniqueness.

In this discussion, our focus is on filtering unique values using the Filter menu. This can be accomplished by utilizing a custom formula in the Filter menu’s custom formula field, which applies to both sorted and unsorted data.

Sample Data (Sorted)

First, I’ll apply my custom formula to a sorted list so you can grasp the concept.

The sample data includes authors’ names in column A and their book titles in column B. As the data is sorted, you can readily identify repeated book titles in column B.

Sample sorted data to filter by unique

Now, let’s explore how to filter unique values—specifically, book titles—using the Filter menu.

How to Filter Unique Values Using the Filter Menu

Before filtering unique values using the Filter menu, decide whether you want to filter the first occurrence or the last.

For instance, let’s consider the book title “The Mysterious Affair at Styles,” which appears in rows 5, 6, and 7. Which row would you like to see, the 5th or the 7th?

If you want to filter the first occurrence, use this formula:

=COUNTIF($B$1:B2, B2)=1

If you want to filter the last occurrence, use this formula:

=COUNTIF(B2:B, B2)=1

Both COUNTIF formulas can effectively filter unique values in the Filter menu. The output will be the same, but there’s a difference when you examine the rows.

Both formulas follow the syntax:

COUNTIF(range, criterion)

In the first formula, the range includes the header row and the row below it ($B$1:B2), while in the second formula, the range encompasses the entire column except for the header (B2:B).

Note: To understand what these formulas return, enter them in cell C2 and drag the fill handle down as far as needed.

Step-by-Step Instructions

  1. Select the data range, here, A1:B16 or A1:B.
  2. Go to the Data menu and click on “Create a filter.”
    Filter Menu
  3. Navigate to cell B1 and click on the filter drop-down, then select “Filter by condition” > “Custom formula is.”
    Filter unique values in filter menu
  4. In the given field, enter one of the above COUNTIF formulas and click OK.
Result after applying unique filter in the filter menu

This will filter the unique rows in column B.

Filtering Unique Values in Unsorted Data Using Filter Menu

Do I need to sort the data before applying the above custom formulas in the Filter menu?

No, you don’t! You can use the same formulas. So needless to say, all the steps are the same.

The formulas will correctly filter the unique records.

Resources

Here are some related resources regarding the filter menu in Google Sheets.

  1. How to Filter by Month Using the Filter Menu in Google Sheets
  2. Filter by Date Range Using Filter Menu in Google Sheets
  3. Filter Menu to Filter Max N Values in Google Sheets – Custom Formula
  4. Using Cell Reference in Filter Menu Filter by Condition in Google Sheets
Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

4 COMMENTS

  1. I used this formula, and it shows only the last value from my list.

    How can I show the first value from my list?

    Thank you in advance for your feedback.

    • Hi, Sopheak Men,

      Sort your data by the column you want to filter. As per my example, it’s column B.

      Then use the below custom formula rule.

      =countif($B$1:$B2,$B2)=1

      Please note that cell B1 contains the column name (field label). But the range in the formula must be referred to as $B$1:$B2, not as $B$2:$B2.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.