This assumes that the values are filled in with no blanks in-between like
Assume that A2 is the first cell with a numeric value
=AVERAGE(OFFSET($A$2,COUNTA($A$2:$A$10000)-1,,-10,))
will average the 10 last values, so for 13 it would be -13 so the best way
is probably something like
=AVERAGE(OFFSET($A$2,COUNTA($A$2:$A$10000)-1,,-E2,))
where E2 will hold the number of values you want to average
regarding the counta part, make sure it is bigger than the table ever will
be and make sure all the cells below the last value in the same column are
empty
-
Regards,
Peo Sjoblom
(No private emails please)
"Tom" wrote in message
...
I have a need to calculate a 10-interval vs x-interval moving average.
Without totaling the last '10' measurements and dividing by 10 to get an
average and then comparing it to, say, '13' by totaling the last 13 and
dividing by 13, how can I make the calculations vary by the '# of
intervals'?
For example, if I want to average the high temperatures from Jan 1-Dec 31,
I
have 365 intervals. If I want to compare the 10 day average vs a 13 day
average I can establish the formula pretty easy for the SPECIFIC number of
days. I want to vary the # days, in this example, so I can see if I can
spot
trends in the data.
So how do I do the GENERAL case of x-intervals?
TIA
|