0
0
Google Sheetsspreadsheet~10 mins

IMPORTHTML for web tables in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sample table of countries and their capitals, similar to a web table that IMPORTHTML would fetch.

CellValue
A1Country
B1Capital
A2France
B2Paris
A3Germany
B3Berlin
A4Italy
B4Rome
Formula Trace
=IMPORTHTML("https://example.com/countries", "table", 1)
Step 1: IMPORTHTML("https://example.com/countries", "table", 1)
Step 2: Place the fetched table data into the sheet starting at the formula cell
Cell Reference Map
Sheet:
+----+---------+---------+
|    |    A    |    B    |
+----+---------+---------+
| 1  | Country | Capital |
| 2  | France  | Paris   |
| 3  | Germany | Berlin  |
| 4  | Italy   | Rome    |
+----+---------+---------+

Formula in cell A1: =IMPORTHTML("https://example.com/countries", "table", 1)

Arrows: Formula fetches entire table into A1:B4
The formula in A1 imports the first table from the given URL, filling cells A1 through B4 with the table data.
Result
Sheet after formula evaluation:
+----+---------+---------+
|    |    A    |    B    |
+----+---------+---------+
| 1  | Country | Capital |
| 2  | France  | Paris   |
| 3  | Germany | Berlin  |
| 4  | Italy   | Rome    |
+----+---------+---------+
The sheet shows the imported table with headers and data from the web page, exactly as fetched by IMPORTHTML.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the number 1 mean in the formula =IMPORTHTML("https://example.com/countries", "table", 1)?
AIt selects the first table on the webpage
BIt selects the first row of the table
CIt selects the first column of the table
DIt limits the import to one cell
Key Result
IMPORTHTML(url, "table", index) imports the entire table at position index from the webpage at url.