Google Sheets IMPORTHTML Function: Syntax, Examples & Tips

The IMPORTHTML function retrieves data from a specified HTML table or list on a webpage, allowing users to import web data into Sheets.
Google Sheets
IMPORTHTML(url, query, index)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is IMPORTHTML?
  3. A Practical Example
  4. IMPORTHTML Formula
  5. Result of the Formula
  6. Why Use IMPORTHTML?
  7. Key Takeaways:
  8. Example use case

Parameters

url:
The URL of the webpage from which you want to import data. This must be a valid web address enclosed in quotation marks.

query:
The type of data you want to import from the webpage. This can be either "table" or "list", indicating whether you want to import a table or a list from the specified URL.

index:
The index of the table or list on the webpage that you want to import. This is a number indicating the position of the table or list (starting from 1) if there are multiple tables or lists on the page.

What is IMPORTHTML?

The IMPORTHTML function in Google Sheets is a useful tool that allows users to import data from a table or list within an HTML page directly into their spreadsheet. This function is particularly handy for pulling in data from websites that present information in a structured format, such as tables or lists, without the need for manual copying and pasting.

In simpler terms, IMPORTHTML enables you to automatically fetch and display data from web pages, making it easier to analyze and work with online information.

A Practical Example

Imagine you want to track the latest cryptocurrency prices from a financial news website that presents this information in a table format.

Example Table on a Website:

CryptocurrencyPrice (USD)Market Cap
Bitcoin40,000750 Billion
Ethereum2,500300 Billion
Litecoin15010 Billion

You want to import this table into your Google Sheets for further analysis.

IMPORTHTML Formula

To achieve this, you would use the IMPORTHTML function as follows:

Google Sheets
=IMPORTHTML("https://example.com/cryptocurrency-prices", "table", 1)

In this formula:

  • "https://example.com/cryptocurrency-prices" is the URL of the webpage containing the table you want to import.
  • "table" specifies that you want to import a table from the webpage.
  • 1 indicates that you want to import the first table found on the page (if there are multiple tables, you can change this number to import a different one).

Result of the Formula

When you apply the IMPORTHTML formula to your Google Sheets, the output would look like this:

CryptocurrencyPrice (USD)Market Cap
Bitcoin40,000750 Billion
Ethereum2,500300 Billion
Litecoin15010 Billion

This table will automatically update whenever the data on the webpage changes, allowing you to have the latest information at your fingertips.

Why Use IMPORTHTML?

IMPORTHTML is beneficial because it automates the process of data collection from the web, saving you time and effort. It eliminates the need for manual data entry and ensures that you are always working with the most current information available online. Additionally, it can be used for various applications, such as tracking financial data, sports statistics, or any other structured data available on the web.

Key Takeaways:

  • IMPORTHTML: A Google Sheets function that imports data from a table or list in an HTML page.
  • Automation: Saves time by automatically fetching and updating data from the web.
  • Versatile: Can be used for various types of data, including financial, sports, and more.
  • User-Friendly: Simplifies the process of data collection, making it accessible for users without programming skills.

IMPORTHTML is an essential function for anyone looking to enhance their data analysis capabilities in Google Sheets by leveraging online information effectively.

Happy spreadsheeting!

Example use case

You want to track live sports scores on your Google Sheet. Use the IMPORTHTML formula to pull the latest scores from a sports website directly into your sheet, allowing you to monitor game results in real-time without manual updates.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.