I am quite new when it comes to Google Sheets, but I just created a function which gets me the Amazon stock price, see below:
var temp = '=INDEX(GoogleFinance("AMZN", "CLOSE", DATEVALUE(A5)),2,2)';
It works but the problem is, that I want to be flexible when it comes to the date (DATEVALUE). Currently, I have a date in my cell A5, but I actually have a IF statement, which uses the variable i
. So, preferably it should at the end look like Ai
whereas of course i
can be 7 or 15 or whatever number.
How can I achieve that?
I already tried A + i
but that did not work.