In the attached spreadsheet, I am stuck on cell R5. The core of what the formula should be is below:
=SUMPRODUCT(SPY!E3:E98,SPY!F3:F98)/SUM(SPY!F3:F98)
However, I want to use a combination of the INDEX, OFFSET, and INDIRECT functions to lookup the values automatically so it refreshes as additional data is added and so that I can drag the code down to the other rows. The VWAP that I am trying to calculate is Year-to-Date. So it should start on the first trading day of the year (can add a hard coded date on the Inputs sheet) and calculate until the most recent trading day.
Can anyone please help me with this?V4.xlsm
Bookmarks