Documentation for RCHGetHTMLTable() function

This function is used to extract an HTML table from a web page.

Syntax:
 
   =RCHGetHTMLTable( URL, Find Begin, Begin Direction, Find End, End Direction )
 
where:
 
    URL= URL of the web page to retrieve.

    Find Begin = String to search for on web page to find start of table.

    Begin Direction = Number of <TABLE tags to searh for after finding the above string to find the start of the table. A negative number indicates to search backwards, positive number forwards.

    Find End = String to search for on web page to find end of table. If blank, the "Find Begin" parameter will be reused.

    End Direction = Number of </TABLE tags to searh for after finding the above string to find the end of the table. A negative number indicates to search backwards, positive number forwards.

Usage Notes:
  • This function returns an array of data (the HTML table), so it needs to be array-entered. To array-enter a formula in EXCEL, first highlight the range of cells where you would like the returned data to appear -- the number of rows and columns for the range will depend on the size of the table you are retrieving and how much of that table you want to see. Next, enter your formula and then press Ctrl-Shift-Enter.

  • What it does -- given this invocation:

        =RCHGetHTMLTable("https://finance.yahoo.com/quote/" & C4 & "/analysis?p=" & C4, ">Earnings Est", -1, ">Growth Est", 1)

    The function will:

        -- In this example the C4 points to a valid ticker
        -- Retrieve HTML source of the Yahoo! Analysis web page.
        -- Search for ">Earnings Est" within the source of the web page.
        -- Set the start of the HTML table to be the first "<TABLE" tag prior to that string (i.e. -1).
        -- Set the end of the HTML table to be the first "</TABLE" tag after that string (i.e. 1).
        -- Return the full table specified by and including the found "<TABLE" and "</TABLE" tags.
Excel SMF Add-In

Examples:

    These have not been tested recently and may be outdated due to changes by Yahoo to their web pages>

    =RCHGetHTMLTable("http://finance.yahoo.com/q/ks?s=MMM","PEG Ratio",-1,"",1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q?d=t&s=IBM","Volume:",-1,"",1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q/ao?s=IBM", "Mean Recommendation", -3, "Mean Recommendation", 1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q/ao?s=IBM", "Mean Target", -3, "Mean Target", 1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q/ao?s=IBM", "Three Months Ago", -4, "Three Months Ago", 1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q/ud?s=IBM", "Research Firm", -1, "Research Firm", 1)
    =RCHGetHTMLTable("http://finance.yahoo.com/q/ae?s=IBM", ">Earnings Est", -2, ">Growth Est", 1)