0

I trying to get the stock price on ceratain dates that are in a colunm A from A2 to A5. The numbers of rows is based on a formula. So I might have dates from A2 to A50. The formula to get the stock price that I am using is index(GOOGLEFINANCE("AAPL","price", datevalue(A2) ) , 2,2) I can copy and paste the formula in column B but I want this to be automated. I am trying to use the ARRAYFORMULA for it but not getting the desired results.

I used this and I am sure there is some syntax error ARRAYFORMULA((A2:A5)(index(GOOGLEFINANCE("AAPL","price", datevalue(A2) ) , 2,2))) I am getting formula parse error. Can someone please help correcting it

  • Does this answer your question? [Google finance as an argument for ArrayFormula](https://stackoverflow.com/questions/60874426/google-finance-as-an-argument-for-arrayformula) – vilc Sep 23 '22 at 07:04

1 Answers1

0

try:

=INDEX(IFNA(VLOOKUP(A2:A5, GOOGLEFINANCE("AAPL", "price", "01/01/2000", TODAY()), 2, 1)))
player0
  • 124,011
  • 12
  • 67
  • 124
  • Thanks for contributing! If you find time please edit an explanation into the answer as it's recommended to [explain entirely code-based answers](https://meta.stackoverflow.com/q/392712/128421) on StackOverflow. – Sven Viking Mar 29 '22 at 00:31