Category: FUNCTION | Updated: 2026-11-22

How to Use the IMPORTRANGE Function in Google Sheets | Pull Data from Another Spreadsheet in Real Time

How to Use the IMPORTRANGE Function

The IMPORTRANGE function is a Google Sheets-exclusive function that lets you import and reference a specified range of cells from another Google Spreadsheet in real time.

Syntax

=IMPORTRANGE(spreadsheet_url, range_string)
  • spreadsheet_url: The URL (or spreadsheet ID) of the source spreadsheet to import data from, enclosed in double quotes "" (required).
  • range_string: The sheet name and cell range to import, formatted as "SheetName!A1:D50" and enclosed in double quotes "" (required).

Table Example

Here is an example of importing data from the "November 2026" sheet (A1:C4) of a separate "Sales Tracker" file into the current sheet.

[Source Spreadsheet (“November 2026” Sheet)]

Row Column A (Date) Column B (Rep) Column C (Sales Amount)
1 Date Rep Sales Amount
2 2026/11/01 Sato 50,000
3 2026/11/02 Suzuki 85,000
4 2026/11/03 Takahashi 42,000

[Current Sheet (Entered in Cell A1)]

  • Formula: =IMPORTRANGE("https://docs.google.com/spreadsheets/d/1abcXYZ123/edit", "November 2026!A1:C4")
  • Result: The header and data (3 rows) from the source spreadsheet spill directly into A1:C4.

Common Errors and Notes

  • Clicking “Allow access” on first connection: The first time you reference another spreadsheet, a #REF! error appears. Hover over the cell and click "Allow access" (once granted, you do not need to re-authorize between those two files).
  • Forgetting double quotes (#ERROR! / #NAME?): Both spreadsheet_url and range_string must be treated as text strings, so always enclose them in "". Omit "" only when referencing cells that contain those strings.
  • Spill destination overwrite error (#REF!): If any cell in the destination range already contains text or a formula, an "Array result was not expanded" error occurs. Keep the destination area clear.
  • Slow performance when importing large datasets: Importing tens of thousands of rows or using many IMPORTRANGE calls on a single sheet can slow down recalculation. Import only the columns and rows you need, or wrap it with QUERY to filter the data.

Frequently Asked Questions

Q. Why does IMPORTRANGE display "#REF! (You need to connect these sheets)"?

A. This is a security check the first time you access another spreadsheet. Hover over the cell showing the error and click the "Allow access" button to load the data.

Q. Does IMPORTRANGE work if I only provide the spreadsheet ID instead of the full URL?

A. Yes, it works. In addition to the full URL (https://docs.google.com/spreadsheets/d/.../edit), specifying just the spreadsheet ID string between "/d/" and "/edit" imports the data in the same way.