Get help

Help center

Guides and answers

Contact support

Write to our team

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Finance

Turn manual finance work into reports that update themselves.

What Finance teams automate

  • Track payables and receivables
  • Build cash flow statements
  • Compare budget against actuals

Inventory and manufacturing

See stock levels and automate ordering.

What inventory and manufacturing teams automate

  • Track inventory across multiple sites
  • Connect sales, purchasing, and warehouse data
  • Link a barcode scanner to your sheet

HR

Run recruitment, attendance, and OKR tracking from your sheets.

What HR teams automate

  • Track recruitment and onboarding
  • Record team OKRs and results
  • Track check-ins, check-outs, and leave

Project management

Assign tasks and track hours without manual updates.

What project teams automate

  • Assign tasks and track status changes
  • Estimate effort and log hours worked
  • Track milestones across projects

Sales and CRM

Track leads and sales performance with automated reports.

What sales teams automate

  • Track and convert leads
  • Set sales goals and track team metrics
  • Monitor sales KPIs on dashboards

Education

Automate attendance, grades, and school purchasing.

What schools automate

  • Track attendance and notify parents
  • Record and compare class grades
  • Track inventory lent to students and staff

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Sign in to

Workflows

Build processes with your team

Automations

Connect files and automate tasks

One system, four parts

AI agents

Virtual Employees that work 24/7

Automations

Connect files and automate tasks

Workflows

Build processes with your team

Data Space

Trusted data sharing and control

Solutions by department

Finance

Reports, budgets, and reconciliations

Inventory and manufacturing

Stock, orders, and production in one view

HR

Timesheets, attendance, and reviews

Project management

Status and workload across projects

Sales and CRM

Leads and deals kept up to date

Education

Student records and school data

Find a use case

By department

How each team uses Sheetgo

By industry

How each industry uses Sheetgo

By company size

Small, medium-sized, or large

Get started

Templates

Ready-made workflows to start from

Learn

Blog

Guides and product news

Customer stories

How teams like yours use Sheetgo

Help center

Guides and answers

Why Sheetgo

Compare

How Sheetgo compares with other tools

Security

How we protect your data

Trust center

Our compliance details

Help center

Guides and answers

Contact support

Write to our team

Workflows

Build processes with your team

Automations

Connect files and automate tasks

How to use the IMPORTDATA function in Google Sheets

The IMPORTDATA formula in Google Sheets is quite a handy tool. It helps us fetch data, that is stored in .csv (comma separated values) or .tsv (tab separated values) files, from a location on the web.

IMPORTDATA syntax

IMPORTDATA(url, [delimiter], [locale])

  • url – required. This is the address (uniform resource locator) on the web, where the .csv file or .tsv file is located. This can take two forms.
    • A valid and fully qualified location in the form of text (enclosed in double quotes). For example: “http://www.census.gov/2010census/csv/pop_change.csv”
    • Or it can be a reference to a cell (like B1) within Google Sheets, where the url is stored.
  • delimiter – optional. The character that separates the values, such as a semicolon or a pipe. If you leave it out, Sheets infers it from the file extension: a comma for .csv and a tab for .tsv.
  • locale – optional. The language and region code used to read the data, such as en_US or de_DE. It changes how dates and decimals are read. If you leave it out, Sheets uses the spreadsheet’s locale.

IMPORTDATA returns the file as a table that starts in the formula cell and fills the cells to the right and below, one row per line of the file.

It might be useful to note that Google Sheets accommodates up to 50 IMPORTDATA formulas on a single spreadsheet.

How to use IMPORTDATA in Google Sheets

Case 1: type the URL into the formula

In the snapshot below, we are trying to import the data into the cell B3, which therefore becomes the destination to key in the IMPORTDATA formula.

Google Sheets importdata 1

We ensure the url is valid, and then enter the formula properly (i.e. enclose urlwithin double quotes) and hit the Enter key. Below is what we see as Google Sheets tries to fetch the data. Bigger the file, the longer it takes to finish the data import.

Google Sheets Importdata: Google Sheets Fetching Data

While the data import is in progress, the cell in which we keyed in the formula, looks like it returned as an error (as indicated by a little red speck on the top right corner of the cell). But, it isn’t an error, just a transient state. Hover the mouse on the cell, to see the following description.

Google Sheets Importdata: Loading Data

As soon as Google Sheets loads the data, the red speck disappears. You’ll notice the data extends from the formula cell (B3) to right and also further down.

Google Sheets importdata 4

So, it is of utmost importance that we keep the expected real estate of the result clear of any preoccupied values. Otherwise, IMPORTDATA formula might cough up a #REF! error. For example, following image explains what could happen, if we had any values, for instance, in cell C9.

Google Sheets importdata 5

Case 2: refer to a cell that holds the URL

Here, we have already stored the url to the .csv in the cell B1. So, we’ll use that cell to refer in the IMPORTDATA formula, and the result is same as that of the first case.

Google Sheets importdata 6

Try it with a public CSV file

To test IMPORTDATA on a file that works, type this address into cell A2 of a blank sheet: https://raw.githubusercontent.com/datasets/country-list/main/data.csv. Then type =IMPORTDATA(A2) in cell D2. Sheets returns two columns, Name and Code, with one row per country. The screenshot uses an older address for the same list.

IMPORTDATA Google Sheets — country names and codes imported from a CSV URL into columns D and E

Learn in this blog post how to easily import RSS feed to Google Sheets.

Google Sheets IMPORTDATA not working

As you have seen, it is very easy to use the IMPORTDATA function. However, there are some known errors and limitations.

The data doesn’t update

While you can always force a refresh by deleting and retyping the formula, there is no native functionality to customize the frequency of automatic updates. Functions that import external data – IMPORTDATA, IMPORTHTML, IMPORTFEED, and IMPORTXML – automatically update every hour. There is simply no way to change this without using a script.

One URL per formula

Unfortunately, it is not possible to import from multiple URLs at the same time, so you’ll need a separate instance of the formula for each URL. While it is technically possible to use this function up to 50 times per spreadsheet, in practice the spreadsheet can become slow and unresponsive.

#N/A error: the file is too large

As you can see in the screenshot below, there is a limitation regarding the size of the file that can be imported. You will see an error message saying the “resource at URL contents exceeded maximum size.” The exact limit is unclear, but it’s lower than if you were importing the CSV file directly.

IMPORTDATA Google Sheets — #N/A error saying the resource at the URL exceeded maximum size

If you come across this issue, try downloading the file from the URL and importing it directly to Sheets.

#REF! error: not enough columns

The function will not automatically increase the number of columns if necessary. You will see an error message saying the “result was not automatically expanded. Please insert more columns.” This means you need to check the number of columns in the source file to ensure that you have enough in your spreadsheet.

IMPORTDATA Google Sheets — #REF! error asking to insert more columns for a GitHub page URL

In the screenshot above, the URL points to GitHub’s web page for the file, not to the file itself, so Sheets tries to split a whole web page into cells. On GitHub, open the file, click Raw, and use that address instead. You also get #REF! when cells inside the result range already hold values. Clear them, as shown in Case 1.

#N/A error: could not fetch the URL

Google’s servers fetch the file, not your browser. If the file sits behind a login, on a company network, or in a private Dropbox or Google Drive folder, the fetch fails. It also fails when the address opens a web page that loads the data with JavaScript. To check, open the URL in a private browser window. If you have to sign in, or you see a page instead of the file, IMPORTDATA can’t read it either.

All the data lands in one column

IMPORTDATA splits each line by the delimiter it expects: a comma for .csv files and a tab for .tsv files. A file that uses semicolons or pipes needs the delimiter set by hand, as in =IMPORTDATA(A2, ";"). If dates or decimals come in wrong, add the file’s locale too, as in =IMPORTDATA(A2, ";", "de_DE") for a German file that uses commas for decimals.

Other ways to import data into Google Sheets

IMPORTDATA only reads CSV and TSV files at a public URL. For other sources, Google Sheets has more import functions:

  • IMPORTRANGE pulls a range of cells from another Google Sheets file.
  • IMPORTHTML imports a table or a list from a web page.
  • IMPORTXML pulls data from web pages and XML files with an XPath query.
  • IMPORTFEED imports an RSS or Atom feed.

For CSV files in Google Drive or OneDrive, Excel files, or data you need to refresh on a schedule, Sheetgo, an AI-powered data automation platform, connects them to your spreadsheet and updates the data automatically. See how to import CSV to Google Sheets automatically, or how to import CSV data into Excel.

You may also like…

google sheets features and formulas

How to find nominal interest rate using Google Sheets

Sarah is a young professional making significant financial decisions. From credit cards to mortgages, student loans, and investment...
google sheets features and formulas

Pull Google Calendar data into Google Sheets using Apps Script

This post was originally published in our community forum. Objective : This guide demonstrates how to use Google Apps Script to pull data...
google sheets features and formulas

Using the PROPER function to capitalize the first letter of each word in Google Sheets

Note: This post was originally published in our community forum. Ever found yourself needing to clean up a list of names, titles, or any...