How to Filter from Another Sheet in Google Sheets
To filter data from another sheet in Google Sheets, you can use the QUERY
or FILTER
function. These functions allow you to import and display data from one sheet to another based on specific criteria. Here's how to use both functions:
Using the QUERY Function
- Open your Google Sheets document.
- Click on the cell where you want to display the filtered data.
- Use the
QUERY
function to reference the data from the other sheet. The syntax for the function is:
=QUERY(SheetName!Range, "SELECT columns WHERE condition")
Replace SheetName
with the name of the sheet containing the data, Range
with the range of cells you want to filter, columns
with the column(s) you want to display, and condition
with the condition(s) the data must meet.
Example: Using the QUERY Function
Let's say you have a sheet named "Sales" containing sales data, and you want to filter all sales made by a specific salesperson, "John Doe," into another sheet. You can use the following formula:
=QUERY(Sales!A1:E, "SELECT A, B, C, D, E WHERE D = 'John Doe'")
This formula will display all rows from columns A to E in the "Sales" sheet where the value in column D is "John Doe".
Using the FILTER Function
- Open your Google Sheets document.
- Click on the cell where you want to display the filtered data.
- Use the
FILTER
function to reference the data from the other sheet. The syntax for the function is:
=FILTER(SheetName!Range, Condition)
Replace SheetName
with the name of the sheet containing the data, Range
with the range of cells you want to filter, and Condition
with the condition(s) the data must meet.
Example: Using the FILTER Function
Continuing with the previous example, let's use the FILTER
function to filter the sales data for "John Doe":
=FILTER(Sales!A1:E, Sales!D1:D = "John Doe")
This formula will display all rows from columns A to E in the "Sales" sheet where the value in column D is "John Doe".
Both QUERY
and FILTER
functions can be used to filter data from another sheet in Google Sheets. Choose the one that best fits your needs and preferences.