I have a single column of data in column A. In column C I would like to calculate the WMA for n periods.
So, if I chose 50 periods then in C100, the formula would calculate the sumproduct(A50:A100;(B50:B100)/sum(B50:B100)
or if I chose 20 periods,then in C101, the formula would calculate the sumproduct(A80:A101;(B80:B101)/sum(B80:B101)
The problem is how to create the values in column B.
To be clear, the end result would have Column A with the data and column C with the corresponding WMA, so that I can plot a graph of the two lines. I would have an unput cell where I can change the value of "n" and the graph would change automatically.
So I need a formula rather than a macro. Is this possible?