Last Updated on October 31, 2023 by Jake Sheridan
In this tutorial, you will learn how to use the IMPORTRANGE function with multiple sheets using the Google Sheet Query.
Use IMPORTRANGE with Multiple Sheets (Google Sheets Query)
The Query function in Google Sheets is the program’s most powerful and flexible feature. With this versatile tool, you can use data commands to change the data in Google Sheets. The majority of pivot table functionality may be duplicated by this single function, which takes the place of numerous others.
The IMPORTRANGE function imports a specified spreadsheet’s range of cells.
The advantage of using the IMPORTRANGE function compared to directly copying and pasting is that even if the formula and spreadsheet stay the same, the IMPORTRANGE function checks for updates hourly while the document is open. The functions must be reloaded if you delete, read, or overwrite cells that have the same formula. The document doesn’t require a reload on the IMPORTRANGE function if you open it and reload it.
By using the formula that will be written in this tutorial, you will be able to import ranges of data from several sheets instead of only one sheet.
Once ready, we’ll get started by utilizing real-world examples to show you how to use the IMPORTRANGE function with multiple sheets using Google Sheets Query.
Understand Google Sheets Query
Before using an example, you will need to understand how a Google Sheets Query work.
=QUERY(data, query, [headers])
Google Sheets query requires 3 arguments:
- the data range you want to look at
- the query you want to run, in quotation marks
- an optional number indicating the number of header rows in your data
IMPORTRANGE Function with Multiple Sheets using Google Sheets Query
Before we begin we will need a group of data to be used for the Google Sheets query formula.
We want to import the stock count from three different Google Sheets.
To begin the query formula, we select an empty cell to input the formula. In this example, it will be A1. Then, we will insert an equal symbol followed by ‘QUERY’ and an open bracket. There will be a blue question mark at the side, you can click on it to reveal the arguments needed for this function to work.
Next, we insert our argument. We will insert the URL as our first argument. Then, we will insert “Stock!A1:B4” which is our second argument. Then do the same for the other sheets using their specific URL. Always remember to close any formulas with a closing bracket to signify that the formula is now complete.
Once you press Enter, only the data from all three sheets will appear. It will look something like this.
- The data returned from the Query function will not be formulated. You can edit the data to your preferences.
That’s all there is to it. You are welcome to copy the example spreadsheet below to see how it is done. The most crucial lesson is to enjoy yourself while doing it.
Example Spreadsheet: Make a copy of the example spreadsheet
In this tutorial, I covered how to use the IMPORTRANGE function with multiple sheets using Google Sheets Query. Want more? Check out all the Google Sheets Tutorials.
More ways to query in Google Sheets:
- Select Multiple Columns
- Select Rows that Contain String
- Use “Not Equal” in QUERY
- How to Create a Pivot Table with QUERY
- How to Use Order By
- How to Use Group By
- How to Filter by Date Range
- TODAY Function
- COUNT Function
- SUM Function
- Extract Top N Values from Range
- Return Only Unique Rows
- QUERY From Another Sheet
- QUERY From Multiple Sheets
- Use CONCAT with QUERY
- Use IMPORTRANGE with Multiple Sheets
- QUERY Using Month
- Use Cell Reference in Formula
- Multiple Criteria in QUERY
- Wildcard Characters
- Label Clause
- Sort with Google Sheets QUERY
- Use Both QUERY & FILTER Together