Get help

Help center

Guides and answers

Contact support

Write to our team

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Finance

Turn manual finance work into reports that update themselves.

What Finance teams automate

  • Track payables and receivables
  • Build cash flow statements
  • Compare budget against actuals

Inventory and manufacturing

See stock levels and automate ordering.

What inventory and manufacturing teams automate

  • Track inventory across multiple sites
  • Connect sales, purchasing, and warehouse data
  • Link a barcode scanner to your sheet

HR

Run recruitment, attendance, and OKR tracking from your sheets.

What HR teams automate

  • Track recruitment and onboarding
  • Record team OKRs and results
  • Track check-ins, check-outs, and leave

Project management

Assign tasks and track hours without manual updates.

What project teams automate

  • Assign tasks and track status changes
  • Estimate effort and log hours worked
  • Track milestones across projects

Sales and CRM

Track leads and sales performance with automated reports.

What sales teams automate

  • Track and convert leads
  • Set sales goals and track team metrics
  • Monitor sales KPIs on dashboards

Education

Automate attendance, grades, and school purchasing.

What schools automate

  • Track attendance and notify parents
  • Record and compare class grades
  • Track inventory lent to students and staff

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Get started

Templates

Ready-made workflows to start from

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Help center

Guides and answers

Contact support

Write to our team

Workflows

Build processes with your team

Automations

Connect files and automate tasks

How to use the FILTER function in Google Sheets

The FILTER function in Google Sheets helps you filter and return rows in a range that meet specified criteria. You can also add multiple criteria across columns. The FILTER function generates a new set of data while keeping the original data intact.

Looking for the filter button or filter views rather than a formula? See how to filter Google Sheets without affecting other users.

If you do not find the information you are looking for in this post, you can check out 100+ Functions & Formulas for Google Sheets & Excel Basics.

Working in Excel instead? The Excel FILTER function follows the same logic and adds an optional argument for what to show when nothing matches.

What is the syntax of the filter function?

This is the basic structure of the filter function:

=FILTER(range, condition1, [condition2, …])
  • range – a reference to the range of cells that the function filters.
  • condition1 – an array, row or column equal in length or width as that of the corresponding first row or column of range respectively. It contains evaluated TRUE or FALSE values.
  • condition2 … – optional and additional arrays, rows or columns containing evaluated TRUE or FALSE values to specify if the corresponding row or column within the range needs consideration for the filtering process.

Please note that you can’t use both row and column conditions in the same function. All conditions should be either columns or rows, and the FILTER function doesn’t let you mix them.

How to use the FILTER function

Below is the sample data on which I will try various combinations of the FILTER function to demonstrate its behaviour.

Google Sheets FILTER function — sample food data with Category, Food, Energy (Kcal), and Fat (g) in A1:D10

Case 1: FILTER with one condition

In this first Google Sheets FILTER example, I will use just one condition and see how it works. This is the formula I will use:

=FILTER(A2:D10,A2:A10="Vegetables")

The condition to filter on the first column is “Vegetables”. So the FILTER function fetches all those rows where the first column has the value “Vegetables”.

Google Sheets FILTER function — the four Vegetables rows returned from F1 by a one-condition filter

I placed the function in cell F1, and accordingly the returned data flows from F1 towards the right and further down. The number of columns the function matches that of the input range. However, the number of rows might vary based on the filter conditions.

So, it is very important to keep cells free of data where you expect the data to flow. Otherwise, the function returns a #REF! Error as demonstrated in the screenshot below.

Google Sheets FILTER function — #REF! error in F1 because a dummy value in F4 blocks the results

Case 2: Filter with two conditions

Let’s add one more filter condition and see what happens.

 =FILTER(A2:D10,A2:A10="Vegetables",C2:C10>20)

I essentially asked Google Sheets to show those rows that belong to the “Vegetables” category and whose energy is greater than 20 Kcal, and the FILTER function obliged!

Google Sheets FILTER function — Broccoli, Cabbage, and Cauliflower, vegetables above 20 Kcal

Case 3: Google Sheets FILTER, multiple conditions

I will add one more condition and see the outcome.

=FILTER(A2:D10,A2:A10="Vegetables",C2:C10>20,D2:D10<0.3)

And it works like a charm!

Google Sheets FILTER function — Cabbage and Cauliflower meet all three conditions

Case 4: Filter with “or” condition

So far all the examples have been using “and” conditions – that is, the data has to meet all the conditions specified in order for it to pass the filter.

However, there is another option – you can use “or” conditions that will work for data that meets any one of multiple conditions. The example below demonstrates this.

=FILTER(A2:D10,(A2:A10="Vegetables")+(D2:D10<0.3))

As you can see, the filter here is finding any item that is a vegetable OR has less than 0.3g of fat. Because only one condition needs to be met, Apple and Broccoli are both included even though an apple is not a vegetable, and broccoli has more than 0.3g of fat. 

In order to use an OR condition, all you need to do is put the conditions in brackets and add them together with a plus sign, instead of separating them by a comma.

Google Sheets FILTER function — OR condition returns Apple along with the vegetables

Case 5: Largest values

Another helpful way of using the FILTER function is to find the top few items in any category.

In the example below, I’ve filtered the data to find the three foods with the largest amount of calories.

=FILTER(A2:D10,(C2:C10>=LARGE(C2:C10,3)))

This is achieved by using the FILTER function in combination with the LARGE function, which identifies the largest numbers in a dataset.

I’ve used the LARGE function to identify the three largest calorie numbers, and then filtered the data according to these. You can use this method to filter for any number of the largest or smallest values.

Google Sheets FILTER function — Almonds, Avocado, and Walnuts, the three highest-calorie foods

Case 6: Sorting filtered results

In the previous example, I found the top 3 foods with the most calories. But as you could see, the results weren’t shown in order from most calorie-dense to least.

To sort the results of the FILTER function, you can combine it with the SORT function.

=SORT(FILTER(A2:D10,(C2:C10>=LARGE(C2:C10,3))),3,FALSE)

All I’ve done here is added the SORT function in front of the FILTER function, then told the SORT function to sort based on column 3 in descending order (by indicating False).

Google Sheets FILTER function — SORT lists the top three by energy, Walnuts first

Case 7: What if there is no match?

Of course, not getting any matches generates an error. This is what it looks like.

Google Sheets FILTER function — #N/A error: No matches are found in FILTER evaluation

Case 8: Breaking the rules

You already know you can’t input row and column type conditions within a single FILTER function. I’ll try that anyway and see what Google Sheets has to say.

Google Sheets FILTER function — mismatched range sizes error from mixing a row and a column condition

How to filter on multiple conditions in Google Sheets

Cases 2 to 4 above show the two ways to combine conditions in the Sheets FILTER function. Separate the conditions with commas when a row has to meet all of them (AND logic). Put each condition in parentheses and add them together with a plus sign when meeting any one of them is enough (OR logic).

The examples below use a sales table in A2:H1001, with the amount in column F, the sales agent in column G, and the date of the sale in column H.

Filter by a date range

1. In an empty cell, type the FILTER function and select the range.

Google Sheets filter by date range — FILTER(A2:H1001, typed in J1 with the syntax tooltip

2. Add the condition – column H must be between June 1st and June 30th of 2022 – and close the parenthesis. Type the ISBETWEEN function and use the date column as the first parameter.

Google Sheets filter by date range — ISBETWEEN on H2:H1001 added with its argument tooltip

3. For the second argument, use the DATE function to provide the start date: 2022, 6, 1. For the third argument, do the same with the end date: 2022, 6, 30.

Google Sheets filter by date range — full formula with DATE(2022,6,1) and DATE(2022,6,30)

4. Skip the third and fourth parameters to ensure the filter includes the start and end dates. Close the parentheses and press ‘Enter’ to see the results.

The finished formula is =FILTER(A2:H1001,ISBETWEEN(H2:H1001,DATE(2022,6,1),DATE(2022,6,30))), and it returns every sale dated in June 2022. For more ways to build dates inside a formula, see how to use the DATE function in Google Sheets.

Google Sheets filter by date range — returned rows dated 6/1/2022 onward highlighted in column Q

AND logic: match every condition

1. Type the FILTER function and select the range.

Google Sheets filter multiple conditions — FILTER(A2:H1001, typed in J1 with the syntax tooltip

2. Add the first condition: values in column G must equal “Agent1”.

Google Sheets filter multiple conditions — first condition G2:G1001 equals Agent1 added

3. Add the second condition: values in column H must be on or after March 15, 2022. Use the DATE function for the date, as in DATE(2022,3,15). If you type 3/15/2022 straight into the formula, Sheets reads it as 3 divided by 15 divided by 2022, so every date passes the condition.

Google Sheets filter multiple conditions — second condition on the date column H2:H1001 added

4. Close the parenthesis and press ‘Enter’ to see the results. The finished formula is =FILTER(A2:H1001,G2:G1001="Agent1",H2:H1001>=DATE(2022,3,15)), and it returns only Agent1’s sales from March 15, 2022 onward.

You can write the same AND filter with an asterisk instead of a comma: =FILTER(A2:H1001,(G2:G1001="Agent1")*(H2:H1001>=DATE(2022,3,15))). Each condition returns TRUE or FALSE, and multiplying them keeps only the rows where both are TRUE.

Google Sheets filter multiple conditions — Agent1 rows dated 3/16/2022 and later highlighted

OR logic: match any condition

To keep rows that meet at least one condition, put each condition in parentheses and add them together with a plus sign, as in Case 4. This formula returns every sale made by Agent1 or Agent3:

=FILTER(A2:H1001,(G2:G1001="Agent1")+(G2:G1001="Agent3"))

Each condition returns 1 for TRUE and 0 for FALSE, so a row passes when the sum is 1 or more. You can mix both kinds of logic in one formula. This one returns sales of $1,000 or more made by either agent:

=FILTER(A2:H1001,((G2:G1001="Agent1")+(G2:G1001="Agent3"))*(F2:F1001>=1000))

Google Sheets FILTER not working?

Let’s go over a short checklist to help you troubleshoot common issues with the filter function:

  1. Check the syntax of your filter function. Ensure that you’ve correctly specified the range of data you want to filter and that the conditions or criteria are accurately defined.
  2. Verify that your data range is correct and points to the intended rows and columns.
  3. Ensure there are no hidden rows or columns within your data range, this can affect the outcome of the filter function.
  4. Examine the filtering criteria you’ve set for filtering your data.

If this doesn’t work, AI might be the answer. For a great prompt to troubleshoot spreadsheet functions check out 15 awesome Chat GPT prompts for spreadsheet users.

You are officially a FILTER builder!

That’s how to get started with the Google Sheets FILTER function. Looking for more spreadsheet tutorials and tips? Check out our other posts below!

The UNIQUE function in Google Sheets can be of great help to you as well. Check it out in our blog post: How to use the UNIQUE function in Google Sheets.

You may also like…

google sheets features and formulas

How to find nominal interest rate using Google Sheets

Sarah is a young professional making significant financial decisions. From credit cards to mortgages, student loans, and investment...
google sheets features and formulas

Pull Google Calendar data into Google Sheets using Apps Script

This post was originally published in our community forum. Objective : This guide demonstrates how to use Google Apps Script to pull data...
google sheets features and formulas

Using the PROPER function to capitalize the first letter of each word in Google Sheets

Note: This post was originally published in our community forum. Ever found yourself needing to clean up a list of names, titles, or any...