" MicromOne: How to Import Wikipedia Tables into Google Sheets Using IMPORTHTML

Pagine

How to Import Wikipedia Tables into Google Sheets Using IMPORTHTML

Google Sheets offers a powerful yet simple way to import data directly from the web. One of the most useful functions for this purpose is IMPORTHTML, which allows you to extract tables and lists from web pages such as Wikipedia. In this article, we’ll look at how to use this function step by step, with a practical example.

What Is the IMPORTHTML Function?

The IMPORTHTML function in Google Sheets lets you pull structured data from a webpage and display it automatically in your spreadsheet. This is especially helpful when working with public datasets, statistics, or frequently updated information.

The basic syntax is:

=IMPORTHTML("URL", "table", index)
  • URL – The web page you want to extract data from

  • "table" or "list" – The type of data you want to import

  • index – The number of the table or list on that page

Example: Importing Demographic Data from Wikipedia

Let’s say you want to import demographic data from Wikipedia into Google Sheets. For example, data from the Demographics of India page.

You can use the following formula:

=IMPORTHTML("http://en.wikipedia.org/wiki/Demographics_of_India", "table", 4)

This formula tells Google Sheets to:

  • Visit the Wikipedia page

  • Look for tables on the page

  • Import the fourth table it finds

Once you press Enter, Google Sheets will automatically load the data into your spreadsheet.

Why Use IMPORTHTML?

Here are a few key benefits:

  • Automatic updates – When the source page changes, your data updates too

  • No manual copy-paste – Saves time and reduces errors

  • Perfect for analysis – Ideal for charts, reports, and dashboards

  • Beginner-friendly – No coding skills required

Tips for Better Results

  • If the imported table isn’t the one you want, try changing the index number

  • Make sure the webpage is public and not blocked

  • Use additional Google Sheets functions (like QUERY, FILTER, or SORT) to clean and analyze the imported data

The IMPORTHTML function is an excellent tool for bloggers, researchers, students, and analysts who want to work with live web data. With just one formula, you can transform publicly available information into a dynamic and useful spreadsheet.