IMPORTRANGE copies data from one Google Sheets file into another and keeps it up to date. It’s perfect when each team keeps its own sheet and you want a combined summary in one place.
Note: IMPORTRANGE is for pulling data from a different file. To use data from another tab in the same file, just reference it directly, for example =Sales!A1.
The syntax
=IMPORTRANGE("spreadsheet_url", "range_string")
- spreadsheet_url: the full URL of the source file, or just its ID. Must be in quotes.
- range_string: the sheet name and range, in quotes, for example
"Sales!A1:E500".
Step-by-step example
- Open the source file and copy its URL from the browser address bar.
- Open the destination file and click the cell where the data should start.
- Type the formula, for example:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123xyz/edit", "Sales!A1:E500") - The first time, the cell shows #REF!. Hover over it and click Allow access.
- The data appears and updates automatically when the source changes.
You only need to allow access once per pair of files. You must have at least view access to the source file.
Use the spreadsheet ID instead of the full URL
The ID is the long code between /d/ and /edit in the URL. This works the same and keeps formulas shorter:
=IMPORTRANGE("abc123xyz", "Sales!A1:E500")
Keep the range open-ended
If the source sheet grows, use a whole-column range so new rows are included:
=IMPORTRANGE("abc123xyz", "Sales!A:E")
Store the URL and range in cells
Put the URL in B1 and the range in B2, then:
=IMPORTRANGE(B1, B2)
This makes it easy to switch sources without editing the formula.
Combine IMPORTRANGE with QUERY
Usually you don’t want all the data, just part of it. Wrap IMPORTRANGE in QUERY. Note that with imported data you refer to columns as Col1, Col2, Col3 instead of A, B, C:
=QUERY(IMPORTRANGE("abc123xyz", "Sales!A:E"), "SELECT Col2, SUM(Col5) WHERE Col1 IS NOT NULL GROUP BY Col2", 1)
This returns total sales per region from the other file. New to QUERY? Start with our QUERY function guide.
Combine data from several files
Stack ranges from different files on top of each other with curly brackets and semicolons:
={IMPORTRANGE("fileID1", "Sales!A2:E"); IMPORTRANGE("fileID2", "Sales!A2:E")}
Both ranges must have the same number of columns. Allow access to each file separately first.
Fixing common problems
| Problem | Cause and fix |
|---|---|
| #REF! “You need to connect these sheets” | Click the cell and choose Allow access. |
| #REF! “You don’t have permission” | Ask the owner to share the source file with you. |
| #REF! “Result was not expanded” | Cells below or to the right already contain data. Clear them. |
| #ERROR! or parse error | Check the quotes and the sheet name. Sheet names with spaces need single quotes: "'Sales 2026'!A:E". |
| Loading… for a long time | The range is very large. Import fewer columns or use QUERY to filter. |
Good to know
- The imported data is read-only. Edit it in the source file.
- Anyone who can see the destination file can see the imported data, even without access to the source. Be careful with sensitive information.
- Too many IMPORTRANGE formulas slow a file down. Import once into a hidden tab, then reference that tab.
Next: learn how to control who can see and edit your files in our guide to organizing Google Drive.
1 thought on “IMPORTRANGE in Google Sheets: Pull Data From Another Sheet”