Session 2 - Data Literacy: Beyond the Basics

3. Visulising your Data
3.4. Googlesheets Function: IMPORTRANGE
Using Google Sheets: Importing Data with =IMPORTRANGE
This guide explains how to use the IMPORTRANGE function to bring data from one Google Sheet into another. This is incredibly useful for consolidating information, sharing specific data sets without granting access to the entire source sheet, and creating dynamic reports.
What is =IMPORTRANGE?
IMPORTRANGE allows you to pull data from a different Google Sheet into your current sheet. The imported data is live; if the source sheet changes, your sheet will automatically update. However, you cannot directly edit the imported data in the destination sheet. Changes must be made in the original source sheet.
Syntax:
=IMPORTRANGE("spreadsheet_url", "range")
Let's break down each part:
=IMPORTRANGE: This is the function name that tells Google Sheets you want to import data."spreadsheet_url": This is the full URL of the source Google Sheet (the one containing the data you want). Make sure to enclose the URL in double quotes. You can find the URL in your browser's address bar when you have the source sheet open. It will look something like this:"https://docs.google.com/spreadsheets/d/[some_long_alphanumeric_code]/edit#gid=0"Crucially, you must include the entire URL, including the
https://...part."range": This specifies the cells you want to import. Use standard A1 notation (e.g., "A1:D10", "Sheet1!A1:B5", "Sheet2!C2:C"). Enclose the range in double quotes. For example:"A1:D10"imports data from cells A1 to D10."Sheet1!A1:B5"imports data from cells A1 to B5 on the sheet named "Sheet1". This is important if your source sheet has multiple tabs."C2:C"imports all data from column C, starting from C2.
Step-by-Step Example:
- Open the Source Sheet: Open the Google Sheet that contains the data you want to import.
- Copy the URL: Copy the entire URL from your browser's address bar.
- Open the Destination Sheet: Open the Google Sheet where you want to import the data.
- Enter the Formula: In the cell where you want the imported data to begin, type
=IMPORTRANGE("spreadsheet_url", "range"), replacing"spreadsheet_url"with the URL you copied and"range"with the desired cell range. For example:=IMPORTRANGE("https://docs.google.com/spreadsheets/d/[some_long_alphanumeric_code]/edit#gid=0", "Sheet1!A1:C20") - Authorize Access: The first time you use
IMPORTRANGEwith a new source sheet, you'll need to grant permission. A message will appear asking you to "Allow access." Click the "Allow access" button. This authorization is a one-time process for each source sheet. - Data Appears: Once authorized, the data from the specified range in the source sheet will appear in your destination sheet.
Important Considerations:
- Authorization: You only need to authorize access once per source spreadsheet.
- Updates: The imported data will automatically update whenever the source sheet is changed.
- Errors: If you see an error, double-check the URL and range. Also, ensure that you have the necessary permissions to access the source sheet (either you own it or it has been shared with you).
- Multiple Ranges: To import multiple non-contiguous ranges, you can use curly braces
{}. For example:=IMPORTRANGE("url", "{Sheet1!A1:B10, Sheet1!D1:E10}") - Sheet Names: Remember to include the sheet name in the range if you are not importing from the first sheet in the source spreadsheet.
Ways you might want to use this:
Consolidating Pupil Attainment DataA teacher with multiple classes (e.g., S1, S2, S3) uses separate spreadsheets for each class, recording CfE levels, assessment results, etc. They create a master spreadsheet and use |
Tracking Pupil Progress Across SubjectsA Guidance Teacher tracks pupil progress across subjects. Each subject teacher has their own spreadsheet. The Guidance Teacher uses |
Creating a Performance OverviewA teacher or Principal Teacher creates an overview of class/year group performance (CfE levels, average scores, progress). Raw data is in separate class spreadsheets. |
Sharing Data with ParentsA teacher shares a pupil's progress report with parents. The full class spreadsheet is confidential. The teacher creates a separate spreadsheet, using |
Collaborating on Pupil DataTeachers in a faculty collaborate on pupil data. One teacher maintains the master spreadsheet. Others use |
Generating ReportsA teacher or Principal Teacher generates reports for the SMT or Education Scotland (attainment data, progress, interventions). Raw data is in their spreadsheet. |
Tracking AttendanceA teacher combines attendance data (from SEEMIS) with other data. |
Tracking ASN InformationA teacher or support for learning teacher maintains a spreadsheet with ASN information. |
You may want to watch this tutorial