Thursday, April 28, 2011

yogi_Compute Historic 52 Week High/Low For A Specified Date

Yogi Anand, D.Eng, P.E.                                  Google Spreadsheet           

wsround said:
I have been searching for a way to get historical data for a stock in my spreadsheet.
I have found the limited data that presents it in an array but what I would like to know is can I get the historical data on the 52 week high and low data. It should have been calculated when the stock was closed on that specific day but the only way I have been able to figure out to do this is to run a data search on my own spreadsheet and that just allows a certain number of calculations before the spreadsheet gets too big and then I can do any other calculations based on the 52 week high/low close and other data that I can get.

One can use high52 and low52 arguments for 52week high and 52week low in the GoogleFinance function for the current date. To get the 52week and 52 week low for a specified date, I first extract the high and low values for the dates in the range of interest and then compute the maximum/minimum value from those as presented in Sheet1.