I would like to calculate a rolling average over 6 periods. I have implemented a rangesum calculation that works well, but the problem is that if it is the first period, I would like to write an if statement that there is only one period and thus QV must only divide by 1 if it is the second period, it must divide by 2 and from 3 periods onwards it can divide by 3...
The formula that I have implemented looks as follows: