IMPORTRANGE function in Google Sheets
IMPORTRANGE brings a range of cells from another Google Sheets file into this one, and keeps it up to date.
In Sheets, each spreadsheet is a separate file with its own web address. IMPORTRANGE is the bridge between files. A manager's summary file can pull each branch's figures from the branch's own file. When the source changes, the copy follows.
The examples above show no results, because they depend on a real second file.
Syntax
=IMPORTRANGE(spreadsheet_url, range_string)| Argument | What it is |
|---|---|
spreadsheet_url | The web address of the other spreadsheet, in quotation marks, or a cell that holds it. The long key from the middle of the address works too. |
range_string | The sheet name and range, as text: "Sheet1!A1:F100". Without a sheet name, the first sheet is used. |
Examples
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123/edit","Sales!A1:F100")Result: depends on live data or changes each timeBrings in A1:F100 from the tab named Sales of the other file. (The address here is a made-up placeholder.)
=IMPORTRANGE(B1,"Sales!A:F")Result: depends on live data or changes each timeThe address kept in cell B1, and whole columns, so new rows arrive by themselves.
=QUERY(IMPORTRANGE(B1,"Sales!A:F"),"select Col2, sum(Col6) where Col1 is not null group by Col2",1)Result: depends on live data or changes each timeSummarising imported data. Inside QUERY, imported columns are called Col1, Col2 and so on.
=SUM(IMPORTRANGE(B1,"Sales!F2:F"))Result: depends on live data or changes each timeA single figure from another file.
=IFERROR(IMPORTRANGE(B1,"Sales!A1:F100"),"Not available")Result: depends on live data or changes each timeA message in place of an error while the data cannot be reached.
How it works
Give the address of the source file and, as text, the tab and range you want. The data appears in the cells below and to the right of the formula.
Allowing access, once
The first time one file imports from another, the cell shows #REF!. Hover over it and a button appears asking you to allow access. Press it once. From then on, any IMPORTRANGE in this file may read that source file.
You can only allow access if you yourself are able to open the source file. If you cannot, ask its owner to share it with you.
Remember what this means: once access is allowed, anyone who can view your file can see the imported data, even if they have no access to the source. Do not import private data into a widely shared file.
Writing the range
The second argument is text, in quotation marks.
"Sales!A1:F100": a fixed block on the tab named Sales."Sales!A:F": whole columns, which grow with the data."'Jan 2026'!A1:D50": a tab name with spaces needs single quotation marks inside the double ones.
Keeping the address in a cell, as in the second example, makes the formula shorter and lets you point several formulas at a new source by changing one cell.
Only values come across
IMPORTRANGE brings values. Formulas, colours, number formats, column widths and notes stay behind. Dates may arrive as numbers until you format the cells.
Working on the imported data
Wrap IMPORTRANGE in another function to import only what you need.
- QUERY filters and totals it. Imported data has no column letters of its own, so the query names columns
Col1,Col2,Col3, counting from the left of the imported range. - FILTER works when both its arguments are imported:
=FILTER(IMPORTRANGE(u,"S!A:F"), IMPORTRANGE(u,"S!C:C")="North"). - VLOOKUP can use an imported range as its table.
Importing a narrow range and filtering at the source keeps both files quicker.
When it is slow or fails
- "Loading..." for a few seconds is normal. The data is fetched over the internet.
#REF!means access has not been allowed, the tab name or range is misspelt, or cells in the way of the result are not empty.- Changes arrive after a short delay, not instantly.
- Chains of imports, where file A imports from B, which imports from C, are slow and fragile. Import from the original source.
- Very large imports can fail. Google's help pages give the current limits.
Common mistakes
- The range written without quotation marks.
- A tab that was renamed in the source, which breaks every import that names it.
- Typing into the area where the imported data needs to land.
- Expecting to edit the imported cells. Change the data in the source file.
In Excel
Excel links workbooks differently: a formula can refer to another file directly, as in ='[Sales.xlsx]Sheet1'!A1. There is no IMPORTRANGE.
Related functions
- QUERYOnly in Sheets
- IMPORTHTML, IMPORTXML and IMPORTDATAWeb and import
- FILTEROnly in Sheets
- VLOOKUPLookup
- IFERROR and IFNALogical
The results on this page were worked out by us from the sample sheet; they were not produced by a script running Google Sheets. If Sheets shows you something different, please tell us.
This is an independent help site. It is not connected with or approved by Google. Google Sheets is a trademark of Google LLC, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.