# Google Sheets IMPORTHTML Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/importhtml-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The IMPORTHTML function retrieves data from a specified HTML table or list on a webpage, allowing users to import web data into Sheets.

```
IMPORTHTML(url, query, index)
```

Generate FormulaExplain Formula

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

Describe the IMPORTHTML you need in plain EnglishGenerate Formula

## 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:

| Cryptocurrency | Price (USD) | Market Cap |
| - | - | - |
| Bitcoin | 40,000 | 750 Billion |
| Ethereum | 2,500 | 300 Billion |
| Litecoin | 150 | 10 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:

```
=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:

| Cryptocurrency | Price (USD) | Market Cap |
| - | - | - |
| Bitcoin | 40,000 | 750 Billion |
| Ethereum | 2,500 | 300 Billion |
| Litecoin | 150 | 10 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.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Filter In Google Sheets](https://betteranalyst.com/google-sheets/how-to-filter-in-google-sheets)
- [How To Find Circular References In Google Sheets](https://betteranalyst.com/google-sheets/how-to-find-circular-references-in-google-sheets)
- [How To Find Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-find-duplicates-in-google-sheets)
- [How To Freeze A Row In Google Sheets](https://betteranalyst.com/google-sheets/how-to-freeze-a-row-in-google-sheets)
- [How To Freeze Panes In Google Sheets](https://betteranalyst.com/google-sheets/how-to-freeze-panes-in-google-sheets)
- [How To Highlight Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-highlight-duplicates-in-google-sheets)
- [How To Insert Checkbox In Google Sheets](https://betteranalyst.com/google-sheets/how-to-insert-checkbox-in-google-sheets)
- [How To Insert Multiple Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-insert-multiple-rows-in-google-sheets)

## 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.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

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