How to Use IMPORTRANGE in Google Sheets: A Step‑by‑Step Guide
1. Understanding IMPORTRANGE Basics
IMPORTRANGE is a Google Sheets‑only function that pulls a range of cells from another spreadsheet (or another tab in the same file) into the current sheet.
IMPORTRANGE(spreadsheet_url, range_string)
| Argument | What it expects | Example |
|---|---|---|
| spreadsheet_url | Full URL or just the spreadsheet ID of the source file. | "https://docs.google.com/spreadsheets/d/1a2b3cD4e5F6g7H8i9J0kLmNoPqrStuVwXyZ/edit" |
| range_string | A string in A1 notation that tells Sheets which sheet and cells to copy. | "Sheet1!A2:C5" |
When the formula runs for the first time, Sheets will display #REF! and ask you to grant permission to the source file. After you click Allow access, the data appears and updates automatically.
Quick example
Source sheet Sheet1 (cells A2:C5) contains:
| A | B | C |
|---|---|---|
| 101 | Alice | 23 |
| 102 | Bob | 31 |
| 103 | Carol | 27 |
| 104 | Dave | 45 |
Destination sheet formula:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1a2b3cD4e5F6g7H8i9J0kLmNoPqrStuVwXyZ/edit","Sheet1!A2:C5")
Result (starting in the cell where the formula is entered):
| 101 | Alice | 23 |
|---|---|---|
| 102 | Bob | 31 |
| 103 | Carol | 27 |
| 104 | Dave | 45 |
Key points
- Sheets‑only – No direct equivalent in Excel (Power Query or VBA are alternatives).
- Permissions – First call requires manual approval; later calls are automatic.
- Dynamic updates – Source changes flow through automatically, usually after a short delay rather than instantly.
- Raw values only – Formatting, data validation, and conditional formatting are not transferred.
- Performance – Large ranges can slow the sheet; limit the range or use a named range when possible.
2. Setting Up the Source Spreadsheet
Before you can pull data, the source file must be ready for external access.
- Create or open the source file
- In Google Drive click New → Google Sheets and give it a clear name (e.g., 2024‑Sales‑Data).
-
If you’re using an existing file, verify that you have edit rights (view‑only works for import but you can’t modify the data later).
-
Organize the data in a clean table
- Put column headers in row 1.
- Avoid blank rows/columns inside the range you’ll share; they can cause
#REF!errors.
Example layout:
| A (Date) | B (Region) | C (Sales $) |
|---|---|---|
| 2024‑01‑01 | North | 12,500 |
| 2024‑01‑02 | South | 9,300 |
| … | … | … |
- (Optional) Define a named range
- Select the block (e.g.,
A1:C100). - Choose Data → Named ranges, name it
SalesData, and click Done. -
Using a named range makes the IMPORTRANGE formula easier to read and protects you from column‑letter shifts.
-
Copy the spreadsheet’s URL or ID
- The ID is the string between
/d/and/edit. -
Example:
https://docs.google.com/spreadsheets/d/1aBcD_EfGhIjKlMnOpQrStUvWxYz1234567890/edit#gid=0→ ID =1aBcD_EfGhIjKlMnOpQrStUvWxYz1234567890. -
Set sharing permissions
- Click Share → add the email of the destination‑sheet owner or set Anyone with the link → Viewer for a more open setup.
- The first time the destination file calls IMPORTRANGE, the user will see a Connect button; after clicking, the connection is saved.
3. Using IMPORTRANGE in Your Destination Sheet
Now that the source is ready, import the data with a single formula.
Step‑by‑step example
- Copy the source URL (or just the ID).
- Identify the range you need. Suppose the source sheet is named SalesData and you want rows 2‑6, columns A‑C:
"SalesData!A2:C6". - Enter the formula in any cell of the destination sheet:
gs
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890/edit#gid=0",
"SalesData!A2:C6")
- Grant access when the
#REF!prompt appears. Click Allow access (or Connect) and the data will populate.
Sample source and expected result
| Source (SalesData) | ||
|---|---|---|
| A | B | C |
| Jan | 120 | East |
| Feb | 150 | West |
| Mar | 130 | East |
| Apr | 170 | West |
| May | 160 | East |
The formula above returns the exact same 5‑row table in the destination sheet.
Quick‑reference table
| Situation | Formula | Note |
|---|---|---|
| Pull an entire sheet | =IMPORTRANGE(url, "Sheet1") |
Omits the !A1:Z part; imports every used cell. |
| Pull a single column | =IMPORTRANGE(url, "Sheet1!B:B") |
Returns the whole column B. |
| Use a named range | =IMPORTRANGE(url, "SalesData") |
Works when the source defines a named range called SalesData. |
| Combine with other functions | See Advanced Tips below. |
4. Managing Permissions and Errors
Common error messages
| Error | Why it occurs | How to fix |
|---|---|---|
#REF! – “You need to connect these sheets” |
No permission granted yet. | Click Allow access in the cell, or run a simple =IMPORTRANGE(url,"A1") first and grant access. |
#REF! – “Invalid range” |
The range string is misspelled, references a non‑existent sheet, or uses an illegal sheet name. | Double‑check the sheet name and A1 notation. Enclose names with spaces in single quotes, e.g., "'Sales Data'!B2:D10". |
#REF! – “Imported content is empty” or “Requested spreadsheet not found” |
The range holds no data, or the URL/ID is wrong, or you cannot open the source file. | Check the URL/ID and range, and ask the owner to share the file with you (Viewer is enough). |
#REF! – “Array result was not expanded because it would overwrite data” |
Cells under or beside the formula already hold data. | Clear the cells in the way, or move the formula to an empty area. |
One‑time permission workflow
- In the destination sheet, type a test formula:
gs
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1aBcD_EfGhIJKlMnOPqrstuVwxYz/edit","Sheet1!A1")
- Click the Allow access button that appears.
- After this connection is established, any other
IMPORTRANGEcalls that reference the same URL will work automatically—no further clicks required.
Tips to avoid pitfalls
- Keep the destination area empty and unmerged; existing data or merged cells stop the array from expanding.
- Limit the imported range (e.g.,
A2:C500) to keep performance snappy. - Use named ranges in the source to protect against column insertions that would otherwise break the formula.
5. Advanced Tips: Combining IMPORTRANGE with Other Functions
Because IMPORTRANGE returns an array, you can nest it inside most Google Sheets functions to build dynamic dashboards.
| Goal | Formula (Sheets) | Explanation |
|---|---|---|
| Filter rows where Region = “West” | =FILTER(IMPORTRANGE(url,"Sales!A2:E"), IMPORTRANGE(url,"Sales!C2:C")="West") |
Returns only rows with “West” in column C. |
| Summarize sales by region | =QUERY(IMPORTRANGE(url,"Sales!A1:E"), "select Col3, sum(Col5) where Col3 is not null group by Col3 label sum(Col5) 'Total Sales'") |
Groups by Region (Col3) and totals Revenue (Col5). |
| Unique list of product names | =UNIQUE(IMPORTRANGE(url,"Inventory!B2:B")) |
Pulls a deduplicated list from column B. |
| Row‑wise calculation (10 % increase) | =ARRAYFORMULA(IMPORTRANGE(url,"Data!A2:B") * 1.1) |
Multiplies every numeric value by 1.1 without dragging. |
| VLOOKUP across workbooks | =VLOOKUP(A2, IMPORTRANGE(url,"Catalog!A:B"), 2, FALSE) |
Looks up the price for the SKU in A2 from a separate Catalog sheet. |
Example: Pull → Clean → Summarize
Source sheet Sales:
| A (Date) | B (Order ID) | C (Region) | D (Product) | E (Revenue) |
|---|---|---|---|---|
| 2024‑01‑01 | 1001 | West | Widget | 250 |
| 2024‑01‑02 | 1002 | East | Gizmo | 180 |
| … | … | … | … | … |
Dashboard formula (in the destination sheet):
=QUERY(
IMPORTRANGE("https://docs.google.com/spreadsheets/d/FILE_ID/edit","Sales!A1:E"),
"select Col3, sum(Col5) where Col3 is not null group by Col3 label sum(Col5) 'Total Sales'",
1)
Result:
| Region | Total Sales |
|---|---|
| East | 1,230 |
| West | 1,540 |
| … | … |
6. FAQ
What is IMPORTRANGE and how does it work?
IMPORTRANGE is a Google Sheets function that imports a rectangular range of cells from another spreadsheet (or another tab) into the current sheet. It takes the source file’s URL (or ID) and an A1‑style range string, returns the values as an array, and updates automatically when the source changes.
Do I need to grant permission every time I use IMPORTRANGE?
No. Permission is required only the first time a destination file accesses a particular source URL. After you click Allow access (or Connect) once, all subsequent IMPORTRANGE calls to that same source work automatically.
Can I use IMPORTRANGE with multiple sheets at once?
Yes. You can import several ranges from the same or different source files by writing separate IMPORTRANGE calls, or by stacking them inside functions like ARRAYFORMULA, FILTER, or QUERY. Each call still follows the same two‑argument syntax, and you can combine them to create cross‑sheet dashboards.
End of guide.