Home > Software design >  How to find the average price between two specific dates in the past in Google Sheets Finance
How to find the average price between two specific dates in the past in Google Sheets Finance

Time:10-26

I'm trying to write a formula to give the average price of a stock between two specific dates in the past in Google Sheets Finance, say between October 3rd, 2013 and November 12th, 2013.

If anyone can help, it would be much appreciated.

Thanks, Nick

CodePudding user response:

try:

=AVERAGE(INDEX(QUERY(GOOGLEFINANCE("TSL"; "price"; "2021/10/03"; "2021/11/12"); 
 "offset 1"; 0);;2))

enter image description here

CodePudding user response:

First you take data from that period. For example: =googlefinance("CURRENCY:EURUSD","price","2013-10-03","2013-11-12","daily")

This builds a table where you have all the rates in 2nd column. Then you have to take only second column using INDEX() formula and take average of it using AVERAGE() formula:

=average(index(googlefinance("CURRENCY:EURUSD","price","2013-10-03","2013-11-12","daily"),,2))

enter image description here

  • Related