Hi all,
i have a large list of numbers in column A, and would like to calculate an average in column B. This average period number will be entered in another sheet or userform, because it has to be dynamic (a period ranging from 5 to 200 periods should be possible). The reason why i wanna make this in a UDF is very simple, i need to make those calculations very often, and wanna get rid of the problem once and for all.
The biggest problem i have is the next one, how to set the offset using VBA, i know how to do it in excel
the function would look something like this
Function MA(Column, Period)
End Function
Where Column is the column where the data is placed, and period is the number of periods that should be used.
Letts say i enter =MA(A:A;12) in cell B45
I would like the cells A45:B56 to be summed and then divided by 12
Any help here is much appreciated.
With regards
Mike
i have a large list of numbers in column A, and would like to calculate an average in column B. This average period number will be entered in another sheet or userform, because it has to be dynamic (a period ranging from 5 to 200 periods should be possible). The reason why i wanna make this in a UDF is very simple, i need to make those calculations very often, and wanna get rid of the problem once and for all.
The biggest problem i have is the next one, how to set the offset using VBA, i know how to do it in excel
the function would look something like this
Function MA(Column, Period)
End Function
Where Column is the column where the data is placed, and period is the number of periods that should be used.
Letts say i enter =MA(A:A;12) in cell B45
I would like the cells A45:B56 to be summed and then divided by 12
Any help here is much appreciated.
With regards
Mike