Quote:
Originally Posted by Travis Hoffman
Thanks, Ed!
Can you please explain in more detail the calculation on the WM Results tab, column G, "Wt. Avg. CCWM", when calculated in "default" mode? How is that number obtained? How is the weighting done?
|
Here is the quick answer directly from the macro.
Code:
Case 2 To 7
Range("G1").Select
ActiveCell.Cells = "Wt.Avg" + cword
For i = 1 To numrow
rscale = 0
rvalue = 0
For j = 1 To numcol
If (a(i, j) <> "") Then
If (a(i, j) <> 0) Then
rscale = rscale + 1 / (mcal - week(j))
rvalue = rvalue + a(i, j) / (mcal - week(j))
End If
End If
Next j
If (rscale <> 0) Then
rrvalue(i) = rvalue / rscale
Else
rrvalue(i) = -99
End If
Next i
When using default, mcal=7 means the weighed average is projected to Week 7. Basically the idea is earlier weeks has less weight than later weeks based on number of weeks to the projected week.
To translate this to English for the exact formula, it will have to wait until I have time after work.