We’re improving Formula Genius. We’re redesigning the app and fixing issues along the way. Sorry for any disruption, and thank you for your patience.
Google Sheets intermediate

How to Import HTML Tables or Lists into Google Sheets?

Struggling to get data from a webpage into your spreadsheet? The IMPORTHTML function makes it easy to pull in tables or lists directly.

Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.

The formula

Prompt

"Import a table or list from a webpage directly into Google Sheets using IMPORTHTML"

Google Sheets
=IMPORTHTML(url, query, index)

This formula imports data from a specified table or list on a webpage into Google Sheets.

Step-by-step breakdown

  1. url: The web address of the page containing the data.
  2. query: Specify 'table' or 'list' to indicate what type of data to import.
  3. index: The index number of the table or list on the page (1 for the first one).
  4. Ensure the URL is accessible and the data is structured correctly.

Edge cases & warnings

  • The webpage is blocked from scraping by robots.txt.
  • The table or list is dynamically generated by JavaScript and not visible in the page source.
  • The specified index does not exist on the page.
  • The URL is incorrect or leads to a 404 error.

Examples

Prompt

"IMPORTHTML('https://example.com', 'table', 1)"

Google Sheets
Imports the first table from the specified webpage.
Prompt

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

Google Sheets
Imports the second list from the specified webpage.

Frequently asked questions

Can I import data from a password-protected site?

No, IMPORTHTML cannot access data behind authentication.

What happens if the webpage structure changes?

The formula may break or return an error if the table or list is no longer in the same format.

Is there a limit to how much data I can import?

Yes, Google Sheets has a limit on the number of cells, which may restrict large imports.

Can't find what you need?

Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.