Excel has some nice data import features, I used them to build more complex reports that interact. As I started using Google Sheets more I needed an equivalent for the import from Microsoft Query feature. The thing I was looking for is called Import Range and this is how you can use it.
When is it useful
Duplicating information is not the best way to go, is is? keeping 3 tables that hold mostly the same information is, well, 3 times more time-consuming than having a single table and importing the data into 3 reports.
The syntax
The syntax of the import range function is not exactly rocker science:
=importrange(spreadsheet_key,sheet_name!range)
Ok, maybe I’ve been a little too brief, let me explain:
- spreadsheet_key: this is basically the URL of the document from which we import *
- sheet!range: after telling Google Sheets what is the document, we need to tell it the exact range of cells that we want to import
An example
=importrange(“https://docs.google.com/spreadsheets/d/1Ajs6qdDYt7dfsA6CNfdBMZ7UzhJ_3L-EaWg1SsmWozM/edit#gid=0″, “sheet1!A:B”)
spreadsheet key = https://docs.google.com/spreadsheets/d/1Ajs6qdDYt7dfsA6CNfdBMZ7UzhJ_3L-EaWg1SsmWozM/edit#gid=0
sheet!range = sheet1!A:B
Using the old Google Sheets?
If you are using the old Google Sheet, the spreadsheet key is a little different:
- New Google Sheets: https://docs.google.com/spreadsheets/d/1Ajs6qdDYt7dfsA6CNfdBMZ7UzhJ_3L-EaWg1SsmWozM/edit#gid=0
- Old Google Sheets: 1Ajs6qdDYt7dfsA6CNfdBMZ7UzhJ_3L-EaWg1SsmWozM
Happy importing 😉