Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Unfortunately not, still manually updating tables. Some day I'll dive into google apps script documentation to see if there is a way. Hope to report with good news.
Edited to clarify. It's changing the document that holds the data from one spreadsheet to another one, not updating the data in the table from the same source.
Good question. googlefinance does weird things sometimes, for example try the formula with -4,4) for date 1/2/15 and it returns only data for 12/29, 12/30 and 12/31, not 1/2 as expected. When you change the formula to -4,5), then 1/2 appears. That being said I can't find a case where -5,5) doesn't work. I guess it doesn't matter how long you go after date of interest, or do you see any issues with that?
The correct answer for date 1/1/2015 is 524.96, which is the close price on 12/31/2014. This expression returns 523.37 which is the close price on 01/02/2015. It will fail for any date that had 2 or more days with the market closed in the previous 5 days counting the date in question. So it only works for Friday or Saturday of a week with no market holidays.
Not sure about the last comment, but you are definitely right about the formula throwing the wrong date result for some cases. This is because the date column that googlefinance returns is a timestamp that has 4pm, which is "larger" than the input date (which is 00:00am). I made an adjustment that solves for this.