How to pull external data from a website into Google Sheets

Google Sheets has an awesome formula that automatically pull data from a website. This can be a huge time saver especially if you manually pulling data frequently.

For this demonstration, I’m going to use the https://www.tsa.gov/coronavirus/passenger-throughput site. I came across this because it is a really interesting dataset to see how travel in the US is recovering as a result of COVID-19.

All you need to do is use the IMPORTHTML function in a cell and pass in a couple of other arguments to retrieve the data.

=IMPORTHTML("https://www.tsa.gov/coronavirus/passenger-throughput","table",1)

In addition to the url, you’ll pass in “table” argument because the data is structured as a table on the website. You’ll also pass in a number as the last argument. Sometimes you have to increment it by 1 in order to pull the data. 1 worked in this case.

You can also find more info on the google documenation here – https://support.google.com/docs/answer/3093339?hl=en

And finally, the benefit of importing the data into Google Sheets is to be able to manipulate the data and then visualize it. I added a column to calculate the year over year volume change and then graphed the data:

Screen Shot 2020-05-15 at 4.34.13 PM


Posted

in

by