0
0
Google Sheetsspreadsheet~5 mins

IMPORTHTML for web tables in Google Sheets - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
IMPORTHTML lets you bring tables or lists from a webpage directly into your Google Sheets. This helps you avoid copying and pasting data manually and keeps your sheet updated with the latest web info.
When you want to track live sports scores from a website table in your sheet
When you need to import a price list from an online store's table for comparison
When you want to pull a list of upcoming events from a webpage into your calendar sheet
When you want to monitor stock prices shown in a web table without manual updates
When you want to grab a list of countries or data from a Wikipedia table automatically
Steps
Step 1: Open
- Google Sheets document
You see a blank or existing spreadsheet ready for data input
Step 2: Select
- a cell where you want the web table to appear
The cell is active and ready for formula input
Step 3: Type
- the formula bar
Formula is entered but not yet executed
💡 Start typing =IMPORTHTML(
Step 4: Enter
- formula bar
Formula is complete and runs, pulling data from the web
💡 Use this format: =IMPORTHTML("URL", "query", index) where URL is the webpage address in quotes, query is either "table" or "list", and index is the number of the table or list on the page
Step 5: Press
- Enter key
The selected cell and following cells fill with the imported table data from the webpage
Before vs After
Before
Cell A1 is empty with no data
After
Cell A1 and cells below fill with the first table data from the specified webpage
Settings Reference
URL
📍 First argument in IMPORTHTML formula
Specifies the webpage to import data from
Default: None
query
📍 Second argument in IMPORTHTML formula
Defines whether to import a table or a list from the webpage
Default: None
index
📍 Third argument in IMPORTHTML formula
Selects which table or list on the page to import if there are multiple
Default: 1
Common Mistakes
Using a URL without quotes in the formula
Google Sheets requires the URL to be a text string inside quotes
Always put the URL inside double quotes, like "https://example.com"
Using the wrong query word like "tables" instead of "table"
The formula only accepts exactly "table" or "list" as the query
Use "table" to import tables or "list" to import lists exactly spelled
Choosing an index number that is higher than the number of tables/lists on the page
The formula returns an error if the index does not exist on the webpage
Check the webpage and use the correct index number starting from 1
Summary
IMPORTHTML imports tables or lists from a webpage into Google Sheets automatically.
You must provide the webpage URL, specify "table" or "list", and choose which one by index.
Remember to put the URL in quotes and use the correct query and index to avoid errors.