
The IMPORTHTML function in Google Sheets pulls a table or a list from a web page straight into your sheet. The formula is =IMPORTHTML("https://example.com/page", "table", 1). This guide shows how to find the right table number, import lists, fix the "Imported content is empty" and "Could not fetch URL" errors, and what the function cannot do. The URL in the examples is a placeholder.
IMPORTHTML syntax
=IMPORTHTML(url, query, index)
- url is the full web address, in quotes, starting with http:// or https://.
- query is either "table" or "list".
- index is the position of the table or list on the page, counting from 1.

Import a table from a web page
Type the formula in an empty cell:
=IMPORTHTML("https://example.com/page", "table", 1)
Sheets fetches the page and fills the cells below and to the right with the first table. Those cells must be empty. If the data does not look right, try index 2, 3 and so on until you find the table you want.

Find the right table number
Pages often hold several tables, and some are hidden menus or layout blocks. There is no number shown on the page, so the usual method is trial and error. Change the index one step at a time and look at what comes back. To avoid repeated fetching, test in a spare sheet.

Import a list
Change the query to "list" to bring in a bulleted or numbered list:
=IMPORTHTML("https://example.com/page", "list", 1)
Put the URL in a cell
Keep the address in a cell, such as A1, so you can change it without editing the formula:
=IMPORTHTML(A1, "table", 1)
Clean up the imported data
Imported cells are formula results, so you cannot edit them directly. Wrap the import in other functions to shape it. For example, =QUERY(IMPORTHTML(A1,"table",1), "select Col1, Col3 where Col3 > 100", 1) keeps two columns and filters rows. Our QUERY function examples explain the syntax. To keep a static copy, copy the results and paste them as values only.
How often does it refresh?
Google says import functions refresh periodically, and you cannot set the exact interval. Treat the data as roughly current, not live to the second. If a number matters for a decision, open the source page too.
Fix common errors
- "Imported content is empty." The table is not in the page's basic HTML. Many modern sites load tables with JavaScript after the page opens, and IMPORTHTML cannot see those.
- "Could not fetch URL." The address is wrong, the page needs a login, or the site blocks automated requests.
- "Resource at url not found." Check the address for typos, and include https://.
- #REF! "Array result was not expanded". Cells in the way are not empty.
- Wrong index. A "Could not fetch" style message may also appear when the index is higher than the number of tables.

What IMPORTHTML cannot do
It cannot read pages behind a login, tables drawn by scripts, or content in images. For files, use IMPORTDATA for CSV or TSV links. To pull data from another spreadsheet, use IMPORTRANGE, as in our IMPORTRANGE guide. Also check the site's terms before you copy its data.
Questions and answers
Does IMPORTHTML work in Excel?
No. Excel uses Data, then From Web (Power Query) for the same job.
Why is my table missing rows?
The page may load more rows when you scroll or click. IMPORTHTML only gets what is in the page source.
Is there a limit on imports?
Google Sheets limits how many import functions one spreadsheet can use, and the limit can change. If you hit it, reduce the number of imports.
Can I import a table from a page that needs a login?
Not with this function. Download the data as a file and upload it, or use the site's export option.
