What if the data that you need for your current sheet is stored in a different one, however? With Google Sheets, you can quickly access data from a different sheet, or even an entirely different Google Sheets document. Learn how to query another sheet in Google Sheets below.
How to Pull Cell Data From Another Sheet in Google Sheets
The QUERY function is a powerful tool for pulling multiple pieces of data from another sheet or document. If you just want to reference a few cells, however, it can be a little overcomplicated. For a quick and easy way to pull cell data from another sheet in Google Sheets:
How to Pull Cell Data From Another Document in Google Sheets
If the data you want to pull into your sheet is in a different Google Sheets document, it’s possible to reference it directly. Here’s how: Unlike the first method, you can’t drag down to fill other cells, since the formula is referencing one specific cell in your other document. You can provide a range of cells in your formula, however. To pull across all the cells from C4 to C8 in one go, for example, you would use the following reference at the end of your formula:
How to Query Another Sheet in Google Sheets
If you have a lot of data you want to pull from another sheet, or you want more control over what gets pulled across, you can use the powerful QUERY function. This is more complicated to use but it is highly configurable. To query another sheet in Google Docs:
How to Query Another Document in Google Sheets
If the data you want to query is in a different document, you’ll need to use a slightly different formula. Here’s how it works:
Useful QUERY Functions in Google Sheets
In the above examples, the SELECT function was used to select the columns that we wanted to query. However, you can use this function to make much more specific selections. Here are a few examples of what you can do:
Select all data=QUERY(‘My Current Sheet’!B3:D13, “SELECT *”, 1)Select columns in a different order=QUERY(‘My Current Sheet’!B3:D13, “SELECT B, D, C”, 1)Select only data over a specific value=QUERY(‘My Current Sheet’!B3:D13, “SELECT B, C WHERE C > 20”, 1)Order the selected data=QUERY(‘My Current Sheet’!B3:D13, “SELECT B, C ORDER BY B DESC”, 1)Select only the top 5 values in ascending order=QUERY(‘My Current Sheet’!B3:D13, “SELECT B, C ORDER BY D ASC LIMIT 5”, 1)Skip the first 10 rows=QUERY(‘My Current Sheet’!B3:D13, “SELECT B, C, D OFFSET 10”, 1)
Learn More About Google Sheets Functions
Google Sheets has hundreds of powerful functions, of which QUERY is just one example. Now you know how to query another sheet in Google Sheets, you might want to learn about some of the other functions. Google Sheets IF statements allow you to make your calculations more intelligent. You can use the SUMIF function in Google Sheets to find the total sum of cells that meet specific criteria, or the COUNTIF function to count the number of cells that meet your criteria. You can also use the VLOOKUP function in Google Sheets to search the leftmost column of your data and return any value from the same row. Comment Name * Email *
Δ Save my name and email and send me emails as new comments are made to this post.