π Introduction
When you're working with multiple Google Sheets, you might often need to pull data from one into another. Instead of copying and pasting, Google Sheets gives you powerful functions like IMPORTRANGE and QUERY to do this automatically and dynamically.
In this guide, youβll learn how to:
- Bring in data from another spreadsheet using IMPORTRANGE
- Filter, sort, and structure that data using QUERY
- Combine both functions to create powerful, real-time reports
This is perfect for dashboards, team reports, project trackers, or anything where data lives in more than one sheet.
π Syntax Overview
IMPORTRANGE lets you import a range of cells from a completely different Google Sheet:
=IMPORTRANGE("spreadsheet_url", "range_string")
β’ "spreadsheet_url" is the link (URL) to the source Google Sheet (must be in quotes)
β’ "range_string" is the tab and cell range, like "Sheet1!A1:C10"
QUERY allows you to search and organize data using SQL-like commands:
=QUERY(data, "SELECT Col1, Col2 WHERE Col1 IS NOT NULL")
β’ data can be a range or another function
β’ "SELECT Col1..." defines what columns you want
β’ WHERE helps you filter the results
π§ͺ Example Formula
Letβs say you have two spreadsheets (with the same layout) from two different teams. You want to combine their data into one master sheet, but only include rows that have a value in Column A.
Hereβs how you can do it:
={QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/URL1", "Sheet1!A1:C10"),
"SELECT Col1, Col2 WHERE Col1 IS NOT NULL");
QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/URL2", "Sheet1!A1:C10"),
"SELECT Col1, Col2 WHERE Col1 IS NOT NULL")}
What this does:
IMPORTRANGEpulls the data from each sheetQUERYfilters to show only rows where Column 1 isnβt empty- The
{ ... ; ... }notation stacks the results from both queries into one list
Tip: The first time you use IMPORTRANGE, Google Sheets will ask for permission β click βAllow accessβ to enable it.