🌐 Web & Import Function · intermediate
IMPORTDATA Function in Google Sheets
Imports a CSV or TSV file from a URL. Simpler than IMPORTHTML for already-structured data.
Syntax
IMPORTDATA(url, [delimiter], [locale])Returns: A spilled array of the file's rows.
Excel equivalent: Power Query 'From CSV' equivalent.
Parameters
| Name | Required | Description |
|---|---|---|
| url | Required | URL pointing to a CSV or TSV file. |
| delimiter | Optional | Override delimiter. Default comma; pass "\t" for TSV. |
| locale | Optional | Locale for number/date parsing. |
Examples
Pull a public CSV
=IMPORTDATA("https://example.com/data.csv")Imports the CSV. Refreshes hourly.
TSV import
=IMPORTDATA(A1, "\t")URL in A1, tab delimiter.
Wrap with QUERY
=QUERY(IMPORTDATA(A1), "SELECT Col1, Col3 WHERE Col5 > 100", 1)Pull and filter in one formula.
When to use an alternative
- IMPORTHTML — HTML table on a page.
- IMPORTXML — XML or specific element.
- Apps Script + UrlFetchApp — Authentication needed.
Common errors and how to fix them
#N/A
Cause: URL inaccessible or non-CSV.
Fix: Test the URL in a browser.
Wrong columns
Cause: Delimiter mismatch.
Fix: Pass correct delimiter.
Related functions
IMPORTHTML
Imports a table or list from a web page. The simplest way to scrape structured data from a public we...
IMPORTXML
Imports data from any XML, HTML, or RSS/Atom URL using an XPath expression. More precise than IMPORT...
IMPORTRANGE
Imports a range of cells from another Google Sheet. The bridge between sheets — used for cross-sprea...
QUERY
Runs a SQL-like query against a range. Google Sheets' most powerful function for filtering, sorting,...
Frequently Asked Questions
Max size?
Around 50MB / 10M cells. Larger: Connected Sheets or Apps Script.
Protected URLs?
No — fetches anonymously. Use Apps Script for authenticated sources.