With the IMPORTFEED formula, we can import data from RSS and Atom feeds into Google Sheets.
IMPORTFEED(url, [query], [headers], [num_items])
- url – this is the address (uniform resource locator) to the HTML page on the web, where the table or list that we are looking to import are located. This can take two forms.
- A valid and fully qualified location in the form of text (enclosed in double quotes). For example: “http://news.google.com/?output=atom”
- Or it can be a reference to a cell (like B1) within Google Sheets, where the url is stored.
- query – this optional parameter specifies what data to fetch from the url. For the list of available query options, check out this link. By default, if no query parameter is defined, IMPORTFEED formula
- headers – Optional indicator that specifies whether the column headers should be included in the data import or not. It is FALSE by default.
- num_items – optional parameter that specifies the number of items to fetch, starting from the most recent. If we don’t specify this parameter, Google Sheets returns all the items published on the channel feed.
Usage: IMPORTFEED Formula
Case # 1: IMPORTFEED(url)
In the snapshot below, we are trying to import the data into the cell B3, which therefore becomes the destination to key in the IMPORTFEED formula.
We ensure the url is valid, i.e. enclose url within double quotes and hit the Enter key. Below is what we see as Google Sheets tries to fetch the data. The larger the feed, the longer it might take to finish the data import.
While the data import is in progress, the cell in which we keyed in the formula, looks like it returned as an error. Please note a little red speck on the top right corner of the cell. However, it isn’t an error, but a transient state. Hover the mouse on the cell, to see the following description.
As soon as Google Sheets loads the data, the red speck disappears. You’ll notice the data extends from the formula cell (B3) to right and also further down.
So, it is of utmost importance that we keep the expected real estate of the result, clear of any preoccupied values. Otherwise, IMPORTFEED formula might cough up a #REF! error. For example, following image explains what could happen, if we had any values, for instance, in cell C9.
Case # 2: IMPORTFEED(url cell reference, titles of the items, include headers, fetch 20 items)
Here, in the cell B1, we have stored the URL to the RSS feed from which we are trying to import data. So, we’ll use that cell to refer in the IMPORTFEED formula.