Main content

Google Sheets IMPORTRANGE Another File

By Szabó Gergő · Updated

IMPORTRANGE copies a range from another file after you click Allow access. The URL and sheet name must be exact.

Syntax and arguments

=IMPORTRANGE("spreadsheet_url","Sheet1!A1:D200")
spreadsheet_url
The full URL or the spreadsheet ID.
range_string
Tab and range in quotes, such as Data!A1:D200.

IMPORTRANGE examples

01
Raw import

Need the whole block.

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123","Data!A1:D200")

Click Allow access the first time in the destination file.

02
Filter after import

Only Paid rows.

=QUERY(IMPORTRANGE("abc123","Data!A1:D200"),"select Col1, Col4 where Col2 = 'Paid'",1)

Imported columns are Col1, Col2, ... inside QUERY.

03
ID only

Shorter formula.

=IMPORTRANGE("abc123","Data!A1:D200")

The ID is the long token between /d/ and /edit.

Common mistakes

  • Forgetting the sheet name

    Include Data! or the first tab is used and the range can be wrong.

  • Editing imported cells

    IMPORTRANGE is live. Edit the source file, not the destination spill.

  • Many IMPORTRANGE calls

    Import once onto a staging tab, then QUERY that tab.

IMPORTRANGE FAQ

Why #REF! permission?

Open the destination cell and click Allow access while signed into an account that can read the source.

Does this work in Excel?

No. Excel uses Power Query or linked workbooks instead.

Can I import another tab in the same file?

Use a normal sheet reference. IMPORTRANGE is for other files.