How to Use IMPORTRANGE in Google Sheets: Simple Guide
Use the
IMPORTRANGE function in Google Sheets to pull data from one spreadsheet into another by specifying the source spreadsheet URL and the range of cells to import. The syntax is =IMPORTRANGE(spreadsheet_url, range_string), where spreadsheet_url is the link to the source sheet and range_string is the cell range like "Sheet1!A1:C10".Syntax
The IMPORTRANGE function has two parts:
- spreadsheet_url: The full URL of the Google Sheets file you want to import data from.
- range_string: The text specifying which cells to import, including the sheet name and cell range, like "Sheet1!A1:B5".
Example syntax:
plaintext
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123xyz456/edit", "Sheet1!A1:B5")
Example
This example imports cells A1 to B3 from a sheet named "Sales" in another spreadsheet. You must replace the URL with your source spreadsheet's URL.
plaintext
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1a2b3c4d5e6f7g8h9i0jklmnopqrstu/edit", "Sales!A1:B3")
Output
Product Quantity
Apples 50
Oranges 30
Common Pitfalls
- Permission Required: The first time you use
IMPORTRANGEwith a new spreadsheet, you must click "Allow access" to connect the sheets. - Incorrect URL: Using a wrong or incomplete URL will cause an error.
- Wrong Range Format: The range string must include the sheet name and use an exclamation mark, like "Sheet1!A1:C10".
- Empty or Protected Cells: Importing protected or empty cells may cause unexpected results.
Wrong example (missing sheet name):
plaintext
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1a2b3c4d5e6f7g8h9i0jklmnopqrstu/edit", "A1:B3") Correct example (with sheet name): =IMPORTRANGE("https://docs.google.com/spreadsheets/d/1a2b3c4d5e6f7g8h9i0jklmnopqrstu/edit", "Sales!A1:B3")
Quick Reference
| Part | Description | Example |
|---|---|---|
| spreadsheet_url | Full URL of the source Google Sheet | https://docs.google.com/spreadsheets/d/abc123xyz456/edit |
| range_string | Sheet name and cell range to import | Sheet1!A1:C10 |
| Permission | Must allow access on first use | Click 'Allow access' prompt |
| Output | Imported data appears in your sheet | Data from source range |
Key Takeaways
Use IMPORTRANGE to import data from another Google Sheets file by specifying its URL and cell range.
Always include the sheet name in the range string, like "Sheet1!A1:B5".
Grant permission when prompted to allow data sharing between sheets.
Check the URL and range format carefully to avoid errors.
Imported data updates automatically when the source changes.