SB
Sheets Bootcamp
Beginner Lookup Function

IMPORTRANGE Function in Google Sheets

IMPORTRANGE imports a range of cells from one Google Sheets spreadsheet into another. Syntax, examples, and access permission errors.

Syntax
IMPORTRANGE(spreadsheet_url, range_string)

IMPORTRANGE in Google Sheets imports a range of cells from another spreadsheet into your current sheet. It is the primary way to pull live data across separate Google Sheets files. The imported data updates automatically when the source changes.

The first time you use IMPORTRANGE with a new source spreadsheet, you need to grant access. Google Sheets prompts you to allow the connection between the two files.

Parameters

ParameterRequiredDescription
spreadsheet_urlYesThe full URL of the source spreadsheet, or its spreadsheet key (the long string between /d/ and /edit in the URL). Must be enclosed in quotes.
range_stringYesThe range to import, in the format "SheetName!A1:B10". The sheet name and range are combined in a single string enclosed in quotes. If the sheet name contains spaces, it does not need extra quotes inside the string.

Examples

Import a range from another spreadsheet

Pull cells A1 through D50 from the โ€œSalesโ€ sheet in another file:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123xyz/edit", "Sales!A1:D50")

This imports 50 rows and 4 columns of data from the โ€œSalesโ€ tab. The data stays linked and updates when the source file changes.

Use the spreadsheet key instead of the full URL

You can pass the key portion of the URL instead of the full address:

=IMPORTRANGE("abc123xyz", "Sheet1!A1:C100")

The key is the long string between /d/ and /edit in a Google Sheets URL. Both the full URL and the key work the same way.

Combine with VLOOKUP

Use IMPORTRANGE as the range argument inside VLOOKUP to look up values across spreadsheets:

=VLOOKUP(A2, IMPORTRANGE("abc123xyz", "Products!A:C"), 3, FALSE)

This searches the imported Products data for the value in A2 and returns the matching value from the third column. The IMPORTRANGE call must already be authorized, or the formula returns an error.

Common Errors

#REF! --- The most frequent IMPORTRANGE error. This appears when you have not yet allowed access between the two spreadsheets. Select the cell, click the โ€œAllow accessโ€ prompt, and the formula resolves. You only need to grant access once per source spreadsheet per destination file.

#REF! (after allowing access) --- The sheet name in range_string does not exist in the source spreadsheet, or the range is invalid. Double-check the exact sheet tab name, including capitalization and spaces.

#VALUE! --- The spreadsheet_url is not a valid Google Sheets URL or key. Verify you copied the full URL or the correct key string. The source file must also be a Google Sheets file, not an Excel upload that has not been converted.

Tips

Once access is granted between two spreadsheets, any IMPORTRANGE formula in that destination file can pull from the same source without a second prompt. The authorization is per file pair, not per formula.

IMPORTRANGE results are read-only. You cannot edit the imported cells in the destination sheet. If you need to transform the data, wrap IMPORTRANGE in QUERY, SORT, or FILTER to reshape it after import.

Want to go deeper?

Check out our full tutorials for step-by-step examples and real-world use cases.

Published February 19, 2026