Arrow left
Back to product guides
Google Sheets Formulas

IMPORTHTML Function in Google Sheets: Explained

In this article, you will learn how to use the IMPORTHTML formula in Google Sheets. 

How does the IMPORTHTML formula in Google Sheets?

The IMPORTHTML function in Google Sheets allows users to import data from a table or list within an HTML page into a Google Sheets spreadsheet. This can be useful for quickly importing structured data from a website or other online source into a spreadsheet for further analysis or processing.

How to use the IMPORTHTML function in Google Sheets

To use the IMPORTHTML function, you need to specify the URL of the HTML page that contains the data you want to import, the table or list that you want to import (identified by its index on the page), and the type of data you want to import (either a "table" or a "list"). These parameters are entered into the formula bar of a cell in your Google Sheets spreadsheet, surrounded by quotation marks (when you manually input these parameters, not by cell reference), in the following format:

=IMPORTHTML(url, query, index)

“url” is an URL of the page, including protocol (e.g., http://), from which you want to pull out a table or list.

“query” is either "list" or "table", depending on which type of structure the desired data has.

“index” is an index, starting at 1, which identifies which table or list in the web page should be returned.

For example, assume you want to import the first table on a page in Wikipedia, located at "https://example.com/page.html", into your Google Sheets worksheet. 

How to import a table from a specific webpage in Google Sheets with an example

You would enter the following formula:

=IMPORTHTML("https://en.wikipedia.org/wiki/Spreadsheet", "table", 1)

Once you have entered the formula, the data from the specified table on the page will be imported into the cell and any cells below it automatically. You can then use the data in this table for further analysis or processing, just like any other data in your spreadsheet.

How the IMPORTHTML function works in Google Sheets

It's important to note that the IMPORTHTML function can only import data from HTML pages that are publicly accessible, so you cannot use it to import data from a password-protected website or a website that requires a login. Additionally, the IMPORTHTML function can only import data from tables or lists within an HTML page, so it may not be suitable for importing data from other sources.

What are the other useful functions in Google Sheets?

If you don’t get the solution to your question in this article or you are interested in learning the other useful functions in Google Sheets, you may find the answers in the following articles.

Read the following articles to make some cases for your analysis.

How to Use CHOOSE Function in Google Sheets

How to Use SWITCH Function in Google Sheets

Move on to these articles if you are interested in them.

How to Use RANK Function in Google Sheets - Organize your dataset by ranking items

ARRAYFORMULA Function in Google Sheets: Explained - Use arrays in non-array formulas

SEQUENCE Function in Google Sheets: Explained - Create a grid of sequential numbers

VALUE Function in Google Sheets: Explained - Convert a number, date, and time string to a number

Go to the articles below to learn how to generate random numbers in Google Sheets.

RAND Function in Google Sheets: Explained

RANDBETWEEN Function in Google Sheets: Explained

RANDARRAY Function in Google Sheets: Explained

Navigate to the following posts to learn how to make a hyperlink and import data from another Google Sheets file or a web page.

HYPERLINK Function in Google Sheets: Explained

How to Use IMPORTRANGE Function in Google Sheets

IMPORTDATA Function in Google Sheets: Explained

Check the articles below if you want to use translation-related functions in Google Sheets.

GOOGLETRANSLATE Function in Google Sheets: Explained - Translate one language to another.

DETECTLANGUAGE Function in Google Sheets: Explained - Identify the language used in a specified cell.

Analyze your live financial data in a snap

Are you learning this formula to visualize financial data, build a financial model, or conduct financial analysis? In that case, LiveFlow may help you automate manual workflows and update numbers in real-time. You can access various financial templates on our website, from the simple Income Statement to Multi-Currency Consolidated Financial Statement. You can also customize these templates as you want without breaking the automated data inflow.

To learn more about LiveFlow, book a demo.

Automate any custom financial dashboard in Google Sheets with LiveFlow

Learn how to do this step-by-step in the video below 👇

Do you need personal help?

Our team of real people are here to help you any time between 9am and 10pm GMT.
Check Icon
Email us at: founders@liveflow.io
Check Icon
Call us at +1 (415) 650-1711