Search code examples
google-sheetsweb-scrapinggoogle-sheets-formulagoogle-finance

Google Finance Google Sheets ImportHTML to retrieve Financial Statements


I can use ImportHTML in Google sheets to retrieve financial data from Yahoo Finance but it is lacking where Google Finance has the data. For example here is a link to Ford's financials on Google Finance how would I grab this data with ImportHTML in Google Sheets?

https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG


Solution

  • It depends on exactly what you want. These get all available tables:

    Income Statement Quarterly Data

    =importhtml(
    "https://www.google.com/finance? q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",2)
    

    Income Statement Annual Data

    =importhtml(
    "https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",3)
    

    Balance Sheet Quarterly Data

    =importhtml(
    "https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",4)
    

    Balance Sheet Annual Data

    =importhtml(
    "https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",5)
    

    Cash Flow Quarterly Data

    =importhtml(
    "https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",6)
    

    Cash Flow Annual Data

    =importhtml(
    "https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",7)
    

    To get other companies, enter the stock symvol (i.e.; F, GOOG, IBM) in a cell and reference the cell in the URL. Like this:

    =importhtml(
    "https://www.google.com/finance?q="&A2&"&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",2) 
    

    The "&A2&" references the cell A2. The formula will get the data for the company in cell A2.