Google Sheets: Pull Data from Another Sheet Based on Criteria


You can use the QUERY function in Google Sheets to pull data from another sheet that meets specific criteria.

You can use the following syntax to do so:

=query(Sheet1!A1:C11, "select * where A='Mavs'", 1)

This particular example pulls data from the range A1:C11 in Sheet1 only for the rows where the value in column A is equal to Mavs.

Note: The last argument of 1 specifies that the range A1:C11 contains a header row.

The following example shows how to use this syntax in practice.

Example: Pull Data From Another Sheet Based on Criteria in Google Sheets

First, let’s enter the following dataset into the first sheet of a Google Sheets spreadsheet:

Now suppose we would like to pull each of the rows that contain “Mavs” in the Team column into Sheet2.

To do so, we can type the following formula into cell A1 in Sheet2:

=query(Sheet1!A1:C11, "select * where A='Mavs'", 1)

Once we press ENTER, all of the rows where the Team columns is equal to Mavs will be pulled into Sheet2:

Google Sheets pull data from another sheet based on criteria

Notice that all three rows where the Team column is equal to Mavs have been pulled from Sheet1 into Sheet2.

Also note that you can use the and operator within the QUERY function to pull data based on multiple criteria.

For example, we can use the following syntax to pull data from Sheet1 where the value in the Team column is equal to Mavs and the value in the Points column is greater than 20:

=query(Sheet1!A1:C11, "select * where A='Mavs' and B>20", 1)

The following screenshot shows how to use this formula in practice:

Notice that the two rows where the Team columns is equal to Mavs and the Points column is greater than 20 have been pulled from Sheet1 into Sheet2.

Additional Resources

The following tutorials explain how to perform other common operations in Google Sheets:

Excel Advanced Filter: How to Use “Contains”
Excel Advanced Filter: How to Use “Does Not Contain”
Excel Advanced Filter: Display Rows with Non-Blank Values

One Reply to “Google Sheets: Pull Data from Another Sheet Based on Criteria”

  1. Thank you for this explanation! Question: can you also pull information form another sheet in the same spreadsheet like you did in this example, but instead ‘Mavs’ or any other text, you can put a selection box; and if the box is selected the query will import that row of the selected range?

    So i.e. on sheet ONE I have a row of 100 names all with a selection box in column A. In sheet TWO I want to show the names of the 20 people I have selected in sheet ONE column A. Please let me know!

Leave a Reply

Your email address will not be published. Required fields are marked *