I am trying to obtain values for the moving volatility of stock prices using STDEV and OFFSET functions. I have a set of prices for one stock over 50 consecutive days (column B from B5 to B54). I cannot simply use STDEV because I need to change the number of days in the volatility calculation (in cell D1) and the spreadsheet needs to automatically adapt to this. First I calculate Ui - change in the stock price LN(Underlying/Underlying-1) - which starts in C5 until C54 (C5 is zero, so actual Ui starts in C6). Then I calculate moving volatility of Ui (below formula for day 2 - in cell D6) using this formula:
=STDEV(OFFSET(C6,0,0,$D$1))*SQRT(365)
But this yields incorrect results. The correct results I am aiming to achieve are in column E. In order to calculate annual volatility I multiply daily volatility by SQRT(365).
Any help to get the right formula which achieves results in column E would be greatly appreciated. Thanks
Bookmarks