โ† Back to Error Directory

IMPORTRANGE Permission Errors in Google Sheets โ€” Complete Fix

A feature Excel doesn't have an equivalent to, with its own unique first-connection handshake step people frequently miss.

Table of Contents

1. Why IMPORTRANGE Needs Explicit Permission

IMPORTRANGE pulls live data from one Google Sheets file into another, crossing a security boundary between two potentially different owners and permission sets. Google requires an explicit, one-time human confirmation the first time any two specific spreadsheets are connected this way, as a deliberate security measure preventing a spreadsheet from silently pulling in data from another file without the user's active awareness.

2. Interactive Demo: First Connection Handshake

See the two-step process IMPORTRANGE requires before data actually flows.

3. Granting Permission the First Time

  1. Type or paste your IMPORTRANGE formula into a cell.
  2. The cell will initially show #REF! along with text indicating the resource needs access to be granted.
  3. Click directly on that cell โ€” a button reading "Allow Access" will appear.
  4. Click it. Google briefly verifies your permission level on the source file, then the formula resolves and displays real data.

This is a one-time step per unique pair of spreadsheet files โ€” once granted, every other IMPORTRANGE formula in your destination file referencing that same source file works immediately without repeating this prompt.

4. Cause 2: URL Syntax Mistakes

IMPORTRANGE's first argument needs either the full spreadsheet URL or just its unique file ID (the long string of characters in the URL between /d/ and /edit). Common mistakes include:

=IMPORTRANGE("Budget", "Sheet1!A1:D10")           โ€” wrong: using a file name instead of URL/ID
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/ABC123/edit#gid=0", "Sheet1!A1:D10")  โ€” works, but the full URL with #gid is unnecessarily long
=IMPORTRANGE("ABC123", "Sheet1!A1:D10")            โ€” cleanest โ€” just the file ID portion

5. Cause 3: Sheet Name Mismatch Within the Source

The second argument's sheet name (before the exclamation mark) must exactly match a tab name that currently exists in the source file. If that tab was renamed after you built your IMPORTRANGE formula, the formula breaks even though the permission connection itself remains valid โ€” this produces a different underlying error than the permission issue, though both can display similarly at a glance.

6. Cause 4: Revoked or Changed Access

If your access level to the source spreadsheet is later downgraded or removed entirely (the owner changes sharing settings, or removes you from the file), previously working IMPORTRANGE formulas will begin failing again, since the connection depends on your continued, currently-valid access to the source at the moment of each recalculation, not just the one-time historical grant.

7. Combining IMPORTRANGE With QUERY for Filtering

IMPORTRANGE alone pulls a fixed range with no filtering capability of its own. A common and powerful pattern wraps it in QUERY() to filter or transform the imported data on the fly:

=QUERY(IMPORTRANGE("ABC123","Sheet1!A1:D1000"), "SELECT Col1, Col3 WHERE Col2='Completed'", 1)

This pulls the full range via IMPORTRANGE, then QUERY filters and reshapes it โ€” a technique Excel has no single-formula equivalent for, since it combines Sheets' unique cross-file import capability with its SQL-like QUERY function in one step.

8. Frequently Asked Questions

Why does IMPORTRANGE show a #REF! error the first time I use it?

The very first time IMPORTRANGE connects two specific spreadsheet files, Google requires an explicit one-time permission grant. Until you click Allow Access on the permission prompt that appears in the cell, IMPORTRANGE will show #REF! with a message indicating access needs to be granted.

Why did IMPORTRANGE stop working after previously working fine?

This typically happens if your access to the source spreadsheet was revoked or changed, the source file was deleted or moved to a different location, or the specific sheet name referenced within the source file was renamed.

Can IMPORTRANGE pull data from a spreadsheet I don't own?

Yes, as long as you have at least viewer access to the source spreadsheet, and you complete the one-time permission grant when prompted. If you lose viewer access later, previously working IMPORTRANGE formulas will begin failing.

Related Guides

Editorial Disclaimer: This guide is developed to the best of our domain knowledge and tested against Excel 2019+, Microsoft 365, and Google Sheets. Content is updated continuously as spreadsheet calculation engines evolve.