No. of Recommendations: 1
It appears that my Google Sheets suggestion in post 273817 above for grabbing Yahoo data has some issues.

I believe it is because the response time from the Yahoo page is too slow that the Google Sheets INDEX function times out before Yahoo returns the data so you get a lot of cells with a #REF error.

One workaround which give better results but is both cumbersome and still not perfect is to avoid using the INDEX function.

One way of doing this is to pull the data into a different sheet.

Lets assume that as before, in Sheet1 we have:

Cell A2 contains the ticker symbol
Cell B1 contains the date for which I want the adjusted close price

In Sheet2, then you could use one cell to pull the URL together. Say we use cell A1. In this cell we would have the formula:

="" & Sheet1!A2 & "/history?period1=" & Sheet1!B1*86400-2209078800 & "&period2=" & Sheet1!B1*86400-2209078800 & "&interval=1d&filter=history&frequency=1d"

Then we could enter the following formula in Cell A3 to pull in the data:

=importHTML(A1, "table",1)

This will pull the data into a table that covers the range A3:G4 and an additional note in A5. The adjusted close price will be in cell F4

So back in Sheet1, to pull the adjusted close back into Cell B2, you would enter the formula


This will probably work for a few datapoints but I don't think will be too successful for a large number of datapoints.

Print the post  


What was Your Dumbest Investment?
Share it with us -- and learn from others' stories of flubs.
When Life Gives You Lemons
We all have had hardships and made poor decisions. The important thing is how we respond and grow. Read the story of a Fool who started from nothing, and looks to gain everything.
Contact Us
Contact Customer Service and other Fool departments here.
Work for Fools?
Winner of the Washingtonian great places to work, and Glassdoor #1 Company to Work For 2015! Have access to all of TMF's online and email products for FREE, and be paid for your contributions to TMF! Click the link and start your Fool career.