Google Sheets: Use IMPORTRANGE with Multiple Sheets


You can use the following basic syntax with IMPORTRANGE in Google Sheets to import data from multiple spreadsheets at once:

=QUERY({
    IMPORTRANGE("URL1", "'sheetname1'!A1:B10");
    IMPORTRANGE("URL2", "'sheetname2'!A1:B10");
    IMPORTRANGE("URL3", "'sheetname3'!A1:B10");
  })

This particular query returns data from three different spreadsheets at once.

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

Example: Use IMPORTRANGE with Multiple Sheets

Suppose we would like to import data from two different Google spreadsheets at once.

The first sheet is located in a tab called stats at the following URL:

The second sheet is located in a tab called stats2 at the following URL:

We can use the following syntax with IMPORTRANGE to import the data from both sheets at once into a new spreadsheet:

=QUERY({IMPORTRANGE("1AdlE9V0aYMdrCmAGtvGXIEfo3szQ1tWRJ2HhJkUhg_4","'stats'!A1:C12");
        IMPORTRANGE("17StTv1xbz658vzhibPH0aSqGX5vXZx3oHkyDqA4uHh8","'stats2'!A1:C6")})

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

Google Sheets IMPORTRANGE with multiple sheets

Notice that the data from both sheets is returned.

Also notice that the header column from the second sheet is returned in row 13.

To prevent this column from being imported, we can insert a where statement into our IMPORTRANGE function:

=QUERY({IMPORTRANGE("1AdlE9V0aYMdrCmAGtvGXIEfo3szQ1tWRJ2HhJkUhg_4","'stats'!A1:C12");
        IMPORTRANGE("17StTv1xbz658vzhibPH0aSqGX5vXZx3oHkyDqA4uHh8","'stats2'!A1:C6")},
        "where Col1!='Player'")

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

Notice that the data from both sheets is returned without the header row from the second sheet.

Additional Resources

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

Google Sheets: How to Query From Another Sheet
Google Sheets Query: How to Use Multiple Criteria in Query
Google Sheets Query: How to Return Only Unique Rows

2 Replies to “Google Sheets: Use IMPORTRANGE with Multiple Sheets”

  1. I am The Treasure of a nonprofit organization/a motorcycle club We track work hours and total at the end of the year for our members as we charge a yearly fee which can be reduced by volunteering. I dont think i have something right in the spread sheet because members are added throughout the year and I would love to figure out how to sort the sheets but sort all the data in the same row at the same time!!

    1. Hi Tiffany…In Google Sheets, sorting data while keeping the rows intact is quite similar to Excel. Here’s how you can sort your data in Google Sheets to ensure that all the information for each member remains in the same row:

      ### Steps to Sort Your Google Sheets Data:

      1. **Select the Data Range:**
      – Highlight all the columns that contain the data for your members, including their names, work hours, fees, and any other information.

      2. **Sort the Data:**
      – Click on **Data** in the top menu.
      – Choose **Sort range** > **Advanced range sorting options**.

      3. **Choose a Sorting Criteria:**
      – In the **Sort Range** dialog box:
      – Check the option that says **Data has header row** if your first row contains headers (like Member Name, Work Hours, etc.).
      – Select the column by which you want to sort (for example, by **Member Name**, **Work Hours**, or **Date Joined**).
      – Choose **A-Z** (ascending) or **Z-A** (descending) based on your preference.

      4. **Multiple Levels of Sorting (Optional):**
      – If you need to sort by more than one column, you can add additional sorting levels by clicking **Add another sort column**.

      5. **Check Your Data:**
      – Ensure that all the information for each member (work hours, fees, etc.) is sorted correctly while staying in the same row.

      This will allow you to sort new members who join during the year without disrupting the alignment of the other data. Let me know if you need any more help!

Leave a Reply

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