I would like to calculate averages and other metrics based on share prices. These share prices are stored in an array and are pulled from Google Finance like this:
=GOOGLEFINANCE("GOOG","price",TODAY()-30,TODAY())
The GoogleFinance
function is decribed here.
How can I return the average share price, the first share, the last share price or any other calculated metric (weighted expontential average, etc) based on the share prices in the array?
I know that Google Spreadsheet provides array formulas (e.g. ARRAYFORMULA) but have a hard time understanding on how they could be used to calculate such metrics. Or, is there any other way to perform this calculations without writing each share price in a cell and calculating the metrics manually.
I would appreciate any help or ideas from you.
Thank you!