IMPORTHTML Function in Google Sheets

IMPORTHTML brings a table or list from a public web page into Google Sheets. Supply the page URL, choose "table" or "list", and enter the structure’s index number.

The result expands into neighboring cells. This tutorial uses a live Wikipedia example to show table selection, list indexing, and extracting one imported column.

IMPORTHTML Function Syntax

=IMPORTHTML(url, query, index)
  • url: The complete page address in quotes, or a cell containing it.
  • query: Either "table" or "list".
  • index: The position of the desired table or list in the HTML source, starting at 1.

Tables and lists have separate numbering. A page can have both table 1 and list 1. The index follows source order, which may differ from the page’s visual arrangement.

See Google’s IMPORTHTML reference for the documented syntax.

When to Use IMPORTHTML

Use it for publicly accessible HTML tables and lists, such as schedules or reference tables. You do not need to copy and paste every row.

To select individual headings, links, or other elements, use IMPORTXML. To import cells from another Google spreadsheet, use IMPORTRANGE.

Import the First Table from a Web Page

  1. Select A2 in an empty area of your sheet.
  2. Enter the formula below.
  3. If an external-data banner appears, have an editor review it and click Allow access.
=IMPORTHTML("https://en.wikipedia.org/wiki/List_of_Apollo_missions","table",1)

In our September 2026 test, the first table returned six columns and eleven rows, including the header. The ten data rows began with SA-1 and ended with AS-105.

IMPORTHTML imports the first Apollo missions table, with its header and ten data rows.

The columns were Mission, LV, Launch, Pad, Remarks, and Refs. Website changes can alter the table’s contents, size, or index after this example was captured.

The Launch values arrived as text in this test, including a time. Applying a date format alone will not convert text into a date value; check and convert the relevant text first.

Choose a Different Table

Change the final argument to 2 to request the second HTML table:

=IMPORTHTML("https://en.wikipedia.org/wiki/List_of_Apollo_missions","table",2)

Place this formula in a separate empty area. Our test returned a header and four data rows, beginning with AS-201 and ending with Apollo 5.

If the wrong table appears, inspect the page’s HTML tables or try another index. Avoid assuming that the first prominent table on screen must be table 1.

Import a List

Use "list" as the second argument to select a list instead:

=IMPORTHTML("https://en.wikipedia.org/wiki/List_of_sovereign_states","list",1)

This returned navigation entries beginning with Main page and Contents in our test, not a list of countries. The result demonstrates why choosing the correct structure and index matters.

A page’s title does not identify its first HTML list. Inspect the source to find the relevant list, or switch to a table query when the desired data is tabular.

Return One Column from an Imported Table

Wrap IMPORTHTML in INDEX to select a column from the returned array:

=INDEX(IMPORTHTML("https://en.wikipedia.org/wiki/List_of_Apollo_missions","table",1),0,2)

The row argument 0 returns all rows of column 2. Our result began with the LV header, followed by SA-1, SA-2, and the remaining launch-vehicle identifiers.

INDEX selects the output column; it does not change which source table IMPORTHTML fetches. Keep enough empty rows below the formula for the selected column.

How IMPORTHTML Refreshes

Google says IMPORTHTML checks for updates hourly while the document is open. A browser reload does not trigger a refresh, but re-entering the formula does.

Repeated imports can hit request limits. Reuse one imported result where practical, and consult Google’s import-function guidance if Sheets reports loading or access errors.

Other Google Sheets articles you may also like