- Got Sheet
- Posts
- Importing Data to Google Sheets (post 2 of 3)
Importing Data to Google Sheets (post 2 of 3)
Using IMPORTDATA and IMPORTFEED to Import Data to Your Google Sheet
This is post 2/3 in the Import Series.
Google Sheets has five built-in functions to import data from various sources into your sheet.
IMPORTRANGE()
IMPORTHTML()
IMPORTDATA(url)
IMPORTFEED(url, [query], [headers], [num_items])
IMPORTXML()
Each of these pulls data from other sources. This could be another spreadsheet, an RSS feed, or a website. We’ll look at the next two of them today: IMPORTDATA() and IMPORTFEED().
VIDEO WALKTHROUGH
IMPORTDATA
This lets us pull in data from a .csv (comma separated values) or a .tsv (tab separated values) file on the internet.
Each of these type of files separates the values with either a comma or a tab which allows Google Sheets to interpret how to import the data into cells.
Here’s a website with tons of datasets in .csv (and other) formats: https://catalog.data.gov/dataset/?res_format=CSV
I picked the New York Powerball Winning Numbers data set to play with.
Google Sheets is smart enough to pull everything in without specifying a delimiter and only giving the url. And unless the data is messed up and not properly separated by commas or tabs, you should not have to provide a delimiter.
=IMPORTDATA(A4)
screenshot of imported data
IMPORTFEED
Oh, RSS! Did you know every podcast has an RSS feed that is a big list of every podcast episode and all the information about it?
This is how iTunes, Spotify and the other podcast distribution services parses all the data about the shows.
The RSS feed is in a format called XML (more on this in the final article on Importing Data), and here’s what it looks like:
screenshot of a podcast XML feed
We can import data from a feed using IMPORTFEED() in Google Sheets. All that is required is the url of the feed.
Don’t judge me; I haven’t updated the podcast in a bit because of my articles and videos…
Like IMPORTDATA(), all that is required is the url of the feed, but there are optional arguments that you can give the function.
In the example below, I’ve queried the feed just for the article titles…and then in the next column I’ve queried it for the url to each episode.
=IMPORTFEED(A2,"items title",TRUE,50)
=IMPORTFEED(A2,"items url",TRUE,50)
screenshot of imported RSS feed
Be sure to check out my first post in this series on using IMPORTRANGE() and IMPORTHTML:
Thank you so much!
It means a lot that you’ve read this, and I hope it’s informed and/or entertained you for a few moments today!
Would love to say hi. Here are the best places to find me:
Ways I can help:
View my spreadsheet and creative products on my Gumroad store.
Need a powerful automation tool for Google Sheets? Try Coefficient to automatically import data and sync with your business systems.
Hire an expert to help complete your next Google Sheets, Apps Script or Google Workplace project.
Reply