Back to Blog

Top 5 Import Functions in Google Sheets

Pull external data with IMPORTDATA, IMPORTXML, IMPORTHTML, IMPORTFEED, and IMPORTRANGE — practical patterns and pitfalls.

Aug 7th, 2026SheetFX

Top 5 Import Functions in Google Sheets

August 7th, 2026

Google Sheets can pull live data from the web and from other spreadsheets without copy-paste. Five built-in import functions cover almost every case: IMPORTDATA, IMPORTXML, IMPORTHTML, IMPORTFEED, and IMPORTRANGE. This guide gives syntax, a realistic example for each, and the pitfalls that bite people in production sheets.

1. IMPORTDATA — CSV or TSV files by URL

IMPORTDATA fetches a comma- or tab-separated file from a public URL and spills it into the grid.

Syntax:

=IMPORTDATA(url)

Example — load a public CSV of exchange rates or a published dataset:

=IMPORTDATA("https://example.com/data/rates.csv")

The first row of the CSV becomes your header row in Sheets. Pair with QUERY or FILTER when you only need a slice of the file:

=QUERY(IMPORTDATA("https://example.com/data/rates.csv"), "SELECT Col1, Col3 WHERE Col2 = 'USD' LIMIT 50", 1)

When to use it: scheduled CSV dumps, open data portals, any stable public file URL.

Watch out for: the URL must be publicly reachable (no login walls). Large files can be slow or hit import size limits. The sheet refreshes on its own schedule — not every second — so treat results as near-live, not real-time.

2. IMPORTXML — scrape structured fields with XPath

IMPORTXML loads an HTML or XML page and extracts nodes with an XPath query.

Syntax:

=IMPORTXML(url, xpath_query)

Example — pull all links’ text from a page:

=IMPORTXML("https://example.com/pricing", "//h2")

Or extract the content of a meta description:

=IMPORTXML("https://example.com", "//meta[@name='description']/@content")

XPath is powerful but brittle: if the site redesigns its markup, your formula breaks. Prefer pages with stable structure, or better, official CSV/API endpoints via IMPORTDATA or Apps Script.

When to use it: small, well-structured public pages where no CSV exists — titles, tables of contents, simple attribute scrapes.

Watch out for: JavaScript-rendered pages often return empty results because Sheets fetches the raw HTML, not the browser DOM after JS runs. Many sites block scrapers. Always have a backup plan.

3. IMPORTHTML — tables and lists from a webpage

IMPORTHTML is a specialized scraper for HTML <table> or list (<ul> / <ol>) elements. You pick the type and the index (1-based) of which table or list on the page you want.

Syntax:

=IMPORTHTML(url, query, index)
  • query is "table" or "list".
  • index is which table/list on the page (first is 1).

Example — first HTML table on a stats page:

=IMPORTHTML("https://example.com/league-standings", "table", 1)

Second ordered/unordered list:

=IMPORTHTML("https://example.com/faq", "list", 2)

When to use it: public standings, reference tables, documentation pages that still serve classic HTML tables.

Watch out for: same fragility as IMPORTXML. Dynamic tables built in JS will not appear. Index numbers shift if the site inserts a new table above yours. Prefer IMPORTDATA when the publisher also offers a downloadable file.

4. IMPORTFEED — RSS and Atom feeds

IMPORTFEED is purpose-built for blog, news, and podcast feeds.

Syntax:

=IMPORTFEED(url, [query], [headers], [num_items])

Example — latest five item titles:

=IMPORTFEED("https://www.example.com/feed.xml", "items title", FALSE, 5)

Include headers and pull more fields by using the default full items view, or request descriptions:

=IMPORTFEED("https://www.example.com/feed.xml", "items", TRUE, 10)

Common query values include "items title", "items url", "items summary", and "items author". For a full walkthrough of feed patterns and combining feeds with QUERY, see How to Import Data from RSS or ATOM Feeds in Google Sheets.

When to use it: content monitoring, editorial calendars, competitor blog trackers, podcast episode lists.

Watch out for: feed URLs change; some sites rate-limit; full-content fields may be truncated to summaries depending on the feed.

5. IMPORTRANGE — data from another Google Sheet

IMPORTRANGE is the workhorse for multi-spreadsheet workflows. It copies a range from a source spreadsheet into the current one and stays linked.

Syntax:

=IMPORTRANGE(spreadsheet_url, range_string)

Example:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123XYZ", "Sales!A1:F500")

You can also pass just the spreadsheet ID as the first argument. The range_string should include the sheet name when the data is not on the first tab: "Sheet2!A1:D".

Permissions (the part people forget)

The first time a spreadsheet evaluates IMPORTRANGE against a new source, Sheets shows Allow access. Someone with edit access on the destination sheet must click it. Until then you get a #REF! error mentioning permission. After access is granted, collaborators on the destination can see the imported values even if they cannot open the source — so treat source sheets carefully if they hold sensitive data.

Practical patterns

Import once into a staging tab, then shape with QUERY / FILTER so you are not re-importing nested inside every chart:

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/abc123XYZ", "Sales!A1:F"), "SELECT Col1, Col4 WHERE Col3 = 'Closed' ORDER BY Col4 DESC", 1)

Combine ranges from multiple sources with array literals when building a master view:

={
  IMPORTRANGE(url1, "Data!A2:C");
  IMPORTRANGE(url2, "Data!A2:C")
}

For dashboard-style filtering after import, the pattern in How to Use FILTER + XLOOKUP for Dynamic Dashboards pairs well with a staging IMPORTRANGE.

Choosing the right import function

| Source | Function | | --- | --- | | Public CSV / TSV file | IMPORTDATA | | Specific HTML/XML nodes (XPath) | IMPORTXML | | Whole HTML table or list | IMPORTHTML | | RSS / Atom feed | IMPORTFEED | | Another Google Spreadsheet | IMPORTRANGE |

Reliability tips that apply to all of them

  • Prefer stable, intentional feeds over scrapes. CSV and RSS break less often than XPath into a marketing site.
  • Isolate imports. Put each import on its own tab. Downstream formulas reference that tab, so a failed import does not cascade into a spiderweb of #N/A across the workbook.
  • Cache with copy-paste values when you need a snapshot. Imports refresh; month-end reports often need a frozen copy.
  • Expect refresh lag. Sheets does not re-fetch on every edit. Opening the file, time-based refresh, and cache behavior all affect freshness.
  • Handle errors. Wrap critical cells with IFERROR only when a blank is safer than an error banner — and still log failures somewhere you will notice.

Related functions

Newsletter

Get weekly Sheets tips in your inbox.

Short, practical Google Sheets and Apps Script updates — no noise, just formulas that work.