IMPORTRANGE function in Google Sheets
Imports a range of cells from a specified spreadsheet.
=IMPORTRANGE(spreadsheet_url, range_string)IMPORTRANGE syntax and parameters
Two arguments, two required.
- spreadsheet_urlstringRequired
The URL of the spreadsheet from where data will be imported. The value for spreadsheet_url must either be enclosed in quotation marks or be a reference to a cell containing the URL of a spreadsheet.
- range_stringstringRequired
A string, of the format "[sheet_name!]range" (e.g. "Sheet1!A2:B6" or "A2:B6") specifying the range to import. The sheet_name component of range_string is optional; by default IMPORTRANGE will import from the given range of the first sheet. The value for range_string must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.
IMPORTRANGE examples
Formulas you'll actually reuse.
A live copy of another spreadsheet's Orders range (click Allow access the first time):
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1AbC…/edit", "Orders!A1:E200")Aggregate the imported data without copying it in:
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1AbC…/edit", "Orders!A1:E200"), "select Col1, sum(Col4) group by Col1")
IMPORTRANGE in Excel
No direct equivalent — here's the way around.
Try IMPORTRANGE in the playground
Edit the example — nothing to install.
Preloaded with the IMPORTRANGE formula from Example 1 — change anything and watch it respond.
IMPORTRANGE errors
What they mean — and the fixes.
#REF!Access isn't granted yet or the sheet name is wrong — hover the cell and click Allow access, and quote the range as "Sheet name!A1:B2".
Related functions
More ways Google Sheets gets this done.
- ENCODEURLEncodes a string of text for the purpose of using in a URL query. .WebExcel
- HYPERLINKCreates a hyperlink inside a cell.WebExcel
- IMPORTDATAImports data at a given url in .csv (comma-separated value) or .tsv (tab-separated value) format.WebNo Excel equivalent
- IMPORTFEEDImports a RSS or ATOM feed.WebNo Excel equivalent
- IMPORTHTMLImports data from a table or list within an HTML page.WebNo Excel equivalent
- IMPORTXMLImports data from any of various structured data types including XML, HTML, CSV, TSV, and RSS and ATOM XML feeds.WebNo Excel equivalent