Skip to content
getgriddy.ai/blog/how-to-use-importrange-in-google-sheets
Google Sheets

How to Use IMPORTRANGE in Google Sheets

IMPORTRANGE pulls data from one Google Sheet into another — live, automatically updated. Here's the syntax, how to grant access, common errors, and how to combine it with other functions.

·5 min read

IMPORTRANGE connects two Google Sheets files, pulling data from one into another and keeping it live. Any time the source file updates, the imported data updates too. It's how you consolidate data from multiple sheets without copy-pasting, and how you share a clean "view" of a sheet without giving anyone edit access to the source.

The syntax

fx
=IMPORTRANGE(spreadsheet_url, range_string)
  • spreadsheet_url — the full URL of the source Google Sheet (in quotes), or a cell reference containing the URL
  • range_string — the tab name and range in the source file, formatted as "SheetName!A1:D100"

Basic example

Pull columns A through D from the "Sales" tab of another file:

fx
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/", "Sales!A1:D100")

First-time setup: When you first use IMPORTRANGE to connect to a new file, you'll see a #REF! error. Click the cell → click "Allow access". This grants the destination sheet permission to read the source. You only need to do this once per source file.

TIP

Instead of using the full URL, put it in a cell (e.g., A1) and reference it: =IMPORTRANGE(A1, "Sales!A1:D100"). This makes it easy to switch source files without editing the formula.

Importing a specific range

To import only rows where data exists (not a fixed range that includes blanks):

Use a generous range like A1:Z10000 rather than trying to calculate exact bounds — IMPORTRANGE handles blank rows cleanly and won't cause performance issues for reasonable sizes.

Common errors

ErrorCauseFix
#REF! on first useAccess not grantedClick cell → Allow access
#REF! You don't have accessNo permission to source fileRequest edit or view access to the source
#REF! Internal errorInvalid URL or range stringCheck the URL and tab name (case-sensitive)
Data is staleKnown limitation — Sheets caches importsWait a few minutes, or open the source file to trigger a refresh

WATCH OUT

The range_string is case-sensitive for the sheet tab name. If the tab is called "Sales Data", "sales data!A:D" will return an error. Copy the tab name exactly.

Combining IMPORTRANGE with other functions

IMPORTRANGE returns an array, so you can wrap it directly in other functions:

Filter imported data on the fly:

fx
=FILTER(IMPORTRANGE("url", "Sales!A:D"), IMPORTRANGE("url", "Sales!C:C")="West")

Count rows from another file:

fx
=COUNTA(IMPORTRANGE("url", "Sales!A:A"))-1

The -1 removes the header row from the count.

The Griddy way

IMPORTRANGE is powerful but brittle — URL changes, tab renames, and access issues break it silently. Just describe what you need to connect:

"Pull all rows from the Pipeline sheet in our CRM tracker where the Stage is 'Closed Won', into this reporting sheet"

Griddy builds the IMPORTRANGE with FILTER combination and handles the cross-file reference.

Skip the manual work

Describe it. Griddy does it.

Instead of writing this formula yourself, just tell Griddy what you need in plain English. Works in Excel and Google Sheets.