How To Use IMPORTHTML in Google Sheets

Last Updated on October 31, 2023 by Jake Sheridan

In this tutorial, you will learn how to use the IMPORTHTML function in Google Sheets.

How To Use IMPORTHTML in Google Sheets

If you are looking for a way to quickly import data from a table in a website into your spreadsheet, then Google Sheets has the perfect function for you.

The IMPORTHTML function allows you to import HTML tables or lists from a web page directly into your spreadsheet.

This can be incredibly useful if you want to quickly and easily get data from a website into your spreadsheet. For example, you could use IMPORTHTML to track data from a website in real time.

In this guide, we will explain how to use IMPORTHTML in Google Sheets. We will try importing a table from a common website such as Wikipedia into our spreadsheet.

How To Import a Table from a Website in Google Sheets.

Here’s how to Import a Table from a Website in Google Sheets.

Step 1

Identify the table you want to import into Google Sheets.

In this example, we want to extract data from a table listing the largest cities in the United States.

Step 2

Copy the URL of the website containing the HTML table.

In this example, we’ll copy the link to the Wikipedia article containing the target table.

Step 3

Select an empty cell in your spreadsheet.

Type the string “=IMPORTHTML(“ to start using the IMPORTHTML formula.

Step 4

The first argument of the IMPORTHTML function will indicate the URL to use when importing.

Ensure that the URL is enclosed with quotation marks.

Step 5

The second argument will indicate whether the target data is a list or a table.

Since we’re extracting an HTML table, we’ll indicate “table” in the second argument.

Step 6

The target URL may contain more than one table to extract. The third argument will indicate which table the function will import.

In this example, we’ve placed “5” in the third argument since the table with our city data is the fifth table in the article.

Step 7

Hit the Enter key to evaluate the IMPORTHTML.

Any changes made in the original HTML table should automatically reflect in the Google Sheets spreadsheet.


This guide should be everything you need to start using the IMPORTHTML function in Google Sheets.

You may make a copy of this example spreadsheet to test it out on your own.