Templates, guides & honest tool reviews for small business

Sunday, November 29, 2026

IMPORTDATA in Google Sheets: Pull CSV Data From a URL

IMPORTDATA in Google Sheets - explanatory illustration for importdata function in google sheets
Illustration: IMPORTDATA in Google Sheets

Section: Excel & Google Sheets

IMPORTDATA in Google Sheets reads a CSV or TSV file from a URL and returns rows and columns. Use =IMPORTDATA(A1) when A1 contains a direct data URL. The examples below describe a supplier price-list workflow, not a tested public price feed. Imported results update periodically, not in real time.

What IMPORTDATA does

The function fetches the file at a URL and splits it into rows and columns. It only reads two formats: comma separated values and tab separated values. A normal web page returns HTML rather than the intended CSV data, so it may produce markup, an error or otherwise unusable output. Use IMPORTHTML for tables on a page and IMPORTRANGE for another Google Sheet.

The syntax

IMPORTDATA takes one argument:

=IMPORTDATA(url)

The URL must include the protocol, so https:// and not just the domain, and it must either be in quotes or be a reference to a cell that holds the address. Putting the address in a cell is the better habit, because you can change the source later without editing every formula.

Syntax (made up) - explanatory illustration for importdata function in google sheets
Syntax (made up) (explanatory illustration, not a software screenshot).

Step by step

  1. Find or create a public CSV link. Many systems offer an export link, and a file in a public folder works too.
  2. Put the address in a cell, for example A1.
  3. In another cell, type =IMPORTDATA(A1) and press Enter.
  4. Wait a moment while the data loads. The sheet shows a loading message first.
  5. Format the columns once the data arrives. Number formats and widths are not carried over from the file.

An example workflow

Suppose your supplier publishes a price list as a CSV at a fixed address. Put that address in A1 and the formula in A3. The rows appear in A3 downward, with each comma in the file starting a new column. If the supplier adds a product, the next refresh brings it in. If you would rather work with the data as a proper table, wrap it in a query or copy the values once and stop importing.

Which function - explanatory illustration for importdata function in google sheets
Which function (explanatory illustration, not a software screenshot).

How often it refreshes

Google lists IMPORTDATA recalculation at one-hour intervals in its calculation-settings help. Treat the result as periodically refreshed data, not a real-time feed. Changing unrelated cells is not a reliable way to force a fresh request, and re-entering a formula does not establish that the underlying source has changed.

Formatting and cleaning the result

The import gives you raw values only. There are no headers unless the file itself has a header row, and there is no formatting. Three habits keep the sheet usable:

  • Put the formula in a clear block and leave empty columns to the right, because extra source rows extend downward and extra fields extend to the right.
  • Do not type anything inside the imported range. Array results cannot be edited cell by cell. Content placed in the intended output area can block expansion.
  • Reference the imported block from another sheet or a query instead of editing it in place.
Import diagnostics - explanatory illustration for importdata function in google sheets
Import diagnostics (explanatory illustration, not a software screenshot).

Common errors and fixes

  • Could not fetch URL. The address is wrong, needs https://, or the file is no longer public. Open the link in a browser to check it downloads a file.
  • Unexpected markup or unusable results. You pointed at an HTML page or a PDF. Use IMPORTHTML for tables, or find an export link that returns CSV.
  • Everything lands in one column. The file uses a separator the function does not expect, or it is not really a CSV. Check the raw file.
  • The data disappears after a while. The source file was moved, deleted or made private. Confirm the link still works.
  • Slow sheet. Several import functions on one file make it heavy, because each one goes out to the internet. Google's own guidance is to reference data inside the same spreadsheet where you can.

IMPORTDATA versus the other import functions

Pick by source type. IMPORTDATA is for CSV and TSV files. IMPORTHTML is for a table or a list inside a web page. IMPORTXML is for pulling values out of structured pages with an XPath query, which is more work but more precise. IMPORTFEED is for RSS and Atom feeds. IMPORTRANGE is for a range in another Google Sheet, and it asks you to grant access the first time. If the source is another spreadsheet inside your own account, IMPORTRANGE is usually the better answer, and our guide to IMPORTRANGE covers the permission step. For selecting structured page elements rather than a CSV file, see IMPORTXML.

Import habits - explanatory illustration for importdata function in google sheets
Import habits (explanatory illustration, not a software screenshot).

When not to use it

If the data is a one-off, download the file and paste it. If the data is sensitive, do not publish it at a public URL just to import it, because anyone with the link can read it. If you need the data joined to your own tables with real formulas, import it into a staging sheet and work from there, or use Apps Script for a scheduled pull with more control.

Questions and answers

Does IMPORTDATA work with an Excel file?

No. It reads CSV and TSV only. Export the file to CSV first.

Can I import a file from Google Drive?

You can use a direct download link that returns the file itself, but a normal sharing link returns a web page, not a CSV, so the function fails. Use the export or download link instead.

Why does the first row become my header?

The function does not create headers. If the file has a header row, it arrives as the first row of data. Freeze it or reference the rows below it in your formulas.

Can I split the imported text into columns differently?

Not inside IMPORTDATA. Import the raw rows and use a split formula, as shown in our guide to the SPLIT function.

Is there a limit on how much data it can pull?

Do not assume an unlimited import size. Large responses can fail or hit service limits, and the spreadsheet itself also has capacity limits. For big data sets, import once and work from a local copy.

Official references

العربية