📊 Lesson 6.2: Import, Export, IMPORTRANGE & Connecting Sheets
Spreadsheets rarely live alone. You'll download a CSV from a bank, pull a range from a teammate's file, or send a report to someone who lives in Excel. This lesson covers getting data in (import and the live IMPORTRANGE), connecting sheets together, and getting data out — plus honest notes on what survives a round trip with Excel.
📚 What You'll Learn
By the end of this lesson, you will be able to:
- Import CSV and Excel files, choosing replace / append / new sheet
- Pull a live range from another spreadsheet with IMPORTRANGE (and grant access)
- Recognize the IMPORTHTML / IMPORTDATA / IMPORTXML family and their limits
- Export to .xlsx, .csv, .pdf and understand Excel round-tripping
- Design a single-source-of-truth pattern across connected files
⏱️ Estimated Time: 50 minutes
🎯 Project: Connect two spreadsheets with IMPORTRANGE, import a CSV, and export a sheet to Excel and PDF.
In This Lesson
Getting Data In
Data arrives in files all the time — a CSV export from your bank, an .xlsx a colleague emailed, a table on a web page. Sheets takes them all.
For a file, use File → Import (or just drag the file onto your Drive). Sheets asks how to bring it in:
- Create new spreadsheet — the file becomes its own Sheet.
- Insert new sheet(s) — add the data as a new tab in the current file.
- Replace spreadsheet / Replace current sheet — overwrite what's there.
- Append to current sheet — add the rows to the bottom of existing data.
For a CSV, watch the separator and how dates/numbers are detected — a CSV is just plain text, so Sheets guesses types (and locale can affect date order). You can also simply paste tabular data copied from a web page or another app; use Paste special if you want values only.
🧠 Mindset
There are two flavors of "getting data in": a one-time import (a snapshot you now own and edit) and a live connection (a link that keeps updating from its source). Knowing which you want is the key decision. Importing a CSV is a snapshot; IMPORTRANGE, coming next, is a live link.
IMPORTRANGE — A Live Link Between Sheets
IMPORTRANGE pulls a range from another spreadsheet into this one, and keeps it
live: change the source and the copy updates. It's how you split data across files while keeping one
master.
=IMPORTRANGE("spreadsheet_url_or_id", "Sheet1!A1:D100")
The first time you use it, the formula shows a #REF! with an "Allow access"
prompt. Click it once to authorize the connection between the two files, and the data flows. (You need at
least view access to the source.) From then on it stays connected.
one clean source"] -->|"IMPORTRANGE"| B["📘 Report file
pulls a live range"] A -->|"IMPORTRANGE"| C["📙 Another report
same live source"] B --> D["📄 Export to Excel or PDF
share the snapshot"]
⚠️ Watch Out
IMPORTRANGE is powerful but has trade-offs: it can be slow with large ranges, it re-fetches periodically rather than instantly, and it depends on the source file staying shared and unmoved. If someone loses access to the source, the import breaks. For heavy or critical data, prefer importing a range no larger than you need, and remember it grants a live data connection — only link files you trust.
The Other IMPORT Functions
Sheets has a small family of functions that pull data from the web. They're genuinely useful, but be honest with yourself about their fragility.
| Function | Pulls | Reality check |
|---|---|---|
IMPORTHTML(url, "table", n) | The nth table or list from a web page | Breaks if the page's structure changes |
IMPORTDATA(url) | A CSV or TSV file at a URL | Needs a public, stable URL |
IMPORTXML(url, xpath) | Specific bits via an XPath query | Powerful but finicky; XPath is advanced |
They're perfect for a quick, personal "pull the current standings from this page" trick. But they depend entirely on the source: if a website redesigns, your IMPORTHTML silently breaks, and heavy use can hit rate limits. Treat them as convenient, not dependable — for anything important, a manual import you control is safer.
💡 A note on live web data
These functions only read public data over the web, and they refresh on Sheets' schedule, not instantly. If a page requires a login or blocks automated access, they won't work — and that's by design, not a bug to fight.
Exporting & Round-Tripping With Excel
Getting data out is easy: File → Download offers Microsoft Excel (.xlsx), CSV (current sheet), PDF, and more. PDF export has handy print options (fit to width, gridlines on/off, which tabs) and is great for a clean report; CSV is the universal plain-data format; .xlsx hands a working spreadsheet to an Excel user.
About round-tripping — exporting to Excel, editing there, importing back — here's the honest picture:
- Usually survives: values, most common formulas and functions, standard number/date formatting, basic charts.
- May shift or drop: Sheets-only functions (like QUERY, IMPORTRANGE, and some Google-specific ones have no Excel equivalent), certain advanced formatting, and features unique to one app.
- Best practice: keep the "master" in one app and treat the other format as an export. Round-tripping repeatedly is where things quietly break.
⚠️ Important Note: You can also work with an Excel file directly in Sheets without converting it — Sheets can open and edit .xlsx files, though a few Sheets-only features are unavailable in that mode. For a true Sheets workbook with full features, convert it (File → Save as Google Sheets).
A Single Source of Truth
Connecting sheets unlocks a professional pattern: one master data file, many report files that read from it. Your team enters data in the master; each report or dashboard uses IMPORTRANGE to pull just what it needs. Update the master and every report reflects it — no copy-pasting, no version drift.
This mirrors the "keep raw data raw" habit from Module 3, scaled across files: the master is the truth, everything else is a view of it. It keeps big collaborations sane. The alternative — twelve people each keeping their own copy — is how organizations end up arguing about which spreadsheet is "the real one."
✅ Pro Tip
Combine IMPORTRANGE with QUERY for a powerful move: pull a live range from the master and
filter/summarize it in one step — =QUERY(IMPORTRANGE(url, "Data!A:D"), "select Col2, sum(Col4) group by Col2", 1).
Note the Col1, Col2 style here, because the data comes from an array (the IMPORTRANGE)
rather than a plain range.
🎯 Project: Connect & Export
You'll practice both directions: pulling live data in and pushing snapshots out.
🏋️ In and out
Objective: Link two spreadsheets with IMPORTRANGE, import a CSV, and export.
Instructions (about 15 minutes):
- (3 min) Create a second spreadsheet ("Master") with a small table of data. Copy its URL.
- (4 min) In your main file, on a new tab, write
=IMPORTRANGE("paste-url-here", "Sheet1!A1:D20")— use your Master's actual tab name in place ofSheet1(e.g.Data!A1:D20if you renamed it). Click "Allow access" when prompted. Confirm the data appears and try editing the master to see the copy update. - (3 min) Make a tiny CSV (or download one you have) and use File → Import → Insert new sheet to bring it in.
- (3 min) Export your main file: File → Download → Microsoft Excel (.xlsx). Open it (or just note the download) to confirm it worked.
- (2 min) Export a clean report as PDF (File → Download → PDF), setting "fit to width" and choosing gridlines off.
💡 Hint — the IMPORTRANGE gotcha
=IMPORTRANGE("https://docs.google.com/…", "Sheet1!A1:D20")
Swap Sheet1 for the source tab's real name (e.g. Data).
First run shows #REF! with an "Allow access" button —
click it ONCE to authorize the link. After that it stays live.
Keep the imported range no bigger than you actually need.
✅ Project Completion Checklist
- IMPORTRANGE pulls a live range from a second spreadsheet (access granted)
- Editing the master updates the imported copy
- A CSV was imported as a new sheet
- The file was exported to .xlsx
- A clean PDF export was produced
🎯 Quick Quiz
Question 1: What must happen the first time you use IMPORTRANGE to link two files?
Question 2: Which is the honest expectation when round-tripping a Sheet to Excel and back?
Best Practices for Connecting Sheets
✅ Do's
- Decide snapshot vs live link before you import.
- Keep one master and let reports read from it with IMPORTRANGE.
- Import only the range you need to keep things fast.
❌ Don'ts
- Don't rely on IMPORTHTML/XML for anything important — websites change.
- Don't round-trip repeatedly between Sheets and Excel; things quietly break.
- Don't link files you don't trust — a live connection shares data.
💡 Pro Tips
- Wrap IMPORTRANGE in QUERY to pull and summarize in one formula (use Col1, Col2 references).
- PDF export with "fit to width" and gridlines off makes a tidy shareable report.
📓 Learning Journal
Keep a learning journal as you work through this course — a document, a note, or a tab in your own spreadsheet. After each lesson, take a few minutes to write down:
- Key concepts you learned
- Techniques that clicked for you
- Questions or confusion points to revisit
- Ideas you want to try in your own sheets
- Your progress and feelings about learning this
✍️ This lesson's prompt: Is there data you currently copy-paste between files or re-download regularly? Could a single master file plus IMPORTRANGE replace that chore? Sketch what the master and the report would each hold.
📝 Lesson Summary
🎓 Key Takeaways
- File → Import brings in CSV/Excel as a snapshot (replace, append, or new sheet).
- IMPORTRANGE creates a live link between spreadsheets — click "Allow access" once.
- The IMPORTHTML/DATA/XML family pulls public web data but is fragile — convenient, not dependable.
- Export to .xlsx/.csv/.pdf; round-trips keep values and common formulas but may drop Sheets-only features. Keep one master.
🎉 What You've Accomplished
You can now move data freely — pulling it in from files and other sheets, linking a whole system of files around one source of truth, and sending polished exports to anyone, Excel users included. That's the connective tissue that turns individual sheets into a real workflow.
❓ Common Questions at This Stage
My IMPORTRANGE shows #REF! — is it broken?
Usually it just needs authorizing: hover the cell and click "Allow access." If it still fails, check that you have access to the source file and that the URL and range are correct.
Should I convert an Excel file or work with it directly?
For full Sheets features (including QUERY and all functions), convert it to a Google Sheet. To make a quick edit and keep it as .xlsx, you can open and edit it directly, accepting that a few Sheets-only features won't be available.
Why is my IMPORTRANGE slow?
Large ranges and many imports add up, and Sheets refreshes them periodically rather than instantly. Import only the columns/rows you need, and consider summarizing at the source.
🔭 Looking Ahead
Next — Lesson 6.3: A Taste of Macros & Apps Script — we close Module 6 with an honest, optional taste of automation: recording a macro, peeking at the code it generates, and understanding what Apps Script can (and can't) do for you.
✅ Before the Next Lesson
- Get one IMPORTRANGE link working between two of your files
- Export a clean PDF of a report you're proud of
- Write your Learning Journal entry for this lesson
📚 Additional Resources
🌟 Encouragement for the Journey
Your sheets aren't islands anymore — they pull from a master, feed reports, and export cleanly to anyone. That's how real teams work. One more Module 6 lesson, and it's a fun one: a peek at automation. 📊