Google Sheets IMPORTRANGE: Pull Live Data Across Spreadsheets
Use =IMPORTRANGE(spreadsheet_url_or_key, "range_string") to sync rows from another Google Sheet automatically without copying and pasting.
1. Basic Syntax & First-Time Access
The syntax for IMPORTRANGE is:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit", "Sheet1!A1:E100")
- First argument (
spreadsheet_url_or_key): Paste the full Google Sheets URL (or just the spreadsheet ID between/d/and/edit) inside double quotes. - Second argument (
range_string): Include the exact tab name followed by an exclamation mark and cell range, such as"Sales Log!A1:F200". If the tab name has spaces, keep it inside the same double-quoted string. - One-time permission prompt: The first time you connect two files, the cell shows
#REF!with a prompt to Allow access. Click the cell and click Allow access—you need view/read access to the source spreadsheet.
2. Worked Example: Centralizing Regional Logs
Suppose a team keeps separate monthly or regional sheets and you want a master summary file to pull clean rows automatically:
| Workflow Goal | Formula Example | What Happens |
|---|---|---|
| Import basic range | =IMPORTRANGE("https://docs.google.com/spreadsheets/d/ABC123/edit", "Expenses!A1:D50") |
Pulls A1:D50 from the Expenses tab and updates when source values change. |
| Filter imported rows with QUERY | =QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/ABC123/edit", "Expenses!A1:D50"), "SELECT Col1, Col3, Col4 WHERE Col2 = 'Paid'", 1) |
Filters only Paid rows and selects columns 1, 3, and 4. Notice QUERY uses Col1, Col2... on IMPORTRANGE results. |
| Stack two sheets vertically | ={IMPORTRANGE("ID_SHEET_1","Jan!A2:D50"); IMPORTRANGE("ID_SHEET_2","Feb!A2:D50")} |
Combines two imported ranges into one continuous table (both must have the same column count). |
Important syntax tip: When wrapping IMPORTRANGE inside QUERY, use Col1, Col2, Col3 (capital C, lowercase ol) instead of column letters A, B, C.
3. Common IMPORTRANGE Errors & Fixes
#REF!("You need connect to these sheets" / "Array result was not expanded"): Either click the cell to grant Allow access, or clear cells below/to the right where the imported range is trying to expand.#ERROR!(Formula parse error): Check that both arguments are enclosed in straight double quotes and separated by a comma (or semicolon in locales that use semicolons as argument separators).- Slow recalculation on huge ranges: Avoid importing entire open-ended columns like
A:Zacross dozens of sheets whenA1:H500covers your actual data. - Need interactive troubleshooting? Check our Error Debugger (#REF!) or read the Google Sheets QUERY Guide to filter and group imported data.
4. Combining IMPORTRANGE With QUERY for Filtered Syncs
Instead of importing 5,000 raw rows only to filter them later, wrap IMPORTRANGE inside QUERY to pull only the columns and rows your dashboard needs:
Watch Out for Col1 vs. Column Letters: Once data passes through
IMPORTRANGE or { } array braces inside QUERY, refer to columns as Col1, Col2, Col3 rather than A, B, C.