IMPORTHTML copies a table or a list from a public web page into your sheet: =IMPORTHTML(B1, "table", 2), where B1 holds the page address and 2 means the second table on that page. It stops working if the page loads its numbers with scripts, sits behind a login, or changes layout, so keep it on a helper tab and not in the middle of your budget.
What do the three arguments mean?
The syntax is IMPORTHTML(url, query, index, locale). The query is the word "table" or "list" in quotes, and the index is a number counting from 1.
| Argument | What you give | Example |
|---|---|---|
| url | The page address, in quotes or in a cell | A cell reference such as B1 |
| query | "table" to take a table, "list" to take a bulleted or numbered list | "table" |
| index | Which table or list on the page, counted from the top, starting at 1 | 2 |
| locale | Optional, controls number and date reading | Usually left out |
The index is the part people get wrong. A page may have several tables, including ones you cannot see, such as layout tables. If index 1 returns the wrong thing, try 2, 3 and so on until the right block turns up.
How do I pull a public table into a helper tab?
- Add a tab called Helper. All imports go here, so a failure stays in one place.
- Paste the page address into B1.
- In A3 write =IMPORTHTML(B1, "table", 1). Wait a few seconds for it to load.
- If the table is the wrong one, change 1 to 2 and so on.
- Check the headings and a few values against the web page itself.
Say the page lists festival holidays, with a Festival column in A and a Date column in B. Your budget tab can then look a date up from the Helper tab with =IFERROR(VLOOKUP("Diwali", Helper!A3:B60, 2, FALSE), "check Helper tab"). The IFERROR message tells you when the import has broken instead of showing a confusing error across your budget.
Why does IMPORTHTML say the imported content is empty?
This is the question people search for most. The function reads the plain page source that a server sends. It does not run the scripts that many pages use to draw their tables after loading. If the numbers you see in your browser are filled in by script, IMPORTHTML sees an empty shell.
- The table is drawn by script after the page loads, so nothing is in the source.
- The page needs you to sign in, accept a pop-up or choose a filter first.
- The index counts a different table than you expect.
- The page address changed, or the page now blocks automated reading.
What happens when the page changes?
Web pages are redesigned without notice. A new banner table can push your table from index 2 to index 3, and the formula will quietly pull the wrong block. Two habits protect you. First, never point budget formulas at the imported block directly; point them at a lookup on the Helper tab, as in the VLOOKUP above, so you control what gets used. Second, keep a pasted-values copy of anything that matters, with the date you copied it.
Should I import a table at all?
Ask three questions. Is the data public and freely available to read? Does it change often enough to justify automation? Would a wrong number hurt? If the answer to the last question is yes, copy the table by hand and note the source and date, as you would on paper.
This function is not suited to bank pages, wallet pages or anything with your personal figures, because those need a login and you should never give your credentials to a sheet or a script. For your own transactions, import a statement file you downloaded yourself. SpendixAI, for example, accepts a statement in PDF, CSV or Excel and shows the rows for your review before anything is saved.
Checklist for a reliable import
- Table or list index tested by eye.
- Imports kept on one Helper tab.
- IFERROR with a plain-language message wherever a formula uses the import.
- A dated pasted-values copy for any month you report on.
- A reminder to re-check the page every few months.
Useful ideas start with a clearer picture of your own spending.
Explore your reports

