Goodafternoon,

I have a file which includes a significant amount of cusips (S&P1500) and dates (2010-2020).
For those cusips I determined the market cap per month. Based on that I was able to determine the delta of market cap.

However, I am not able to find a solution to do a loop for the variance of the change in market cap. The variance of the change (delta) in market cap is calculated based on the preceding 60 months.

So for instance, when I want to determine the variance of change in market cap in januari 2016, I use the variance over the period jan 2011 - dec 2015. For februari 2016 I would like to use the variance of change in market cap over the period feb 2011- jan 2016 etc (so the range is always 60). Hope that my question is clear.

Thank you in advance.

Brgds,

James