Moving Average - How can I make the function?

A

ambrosinid

Hi everybody!

I need to construct a function to calculate (not simply calculate it!!)
the moving average for the following data

Day Data Moving average (5 days)
01-gen-06 5
02-gen-06 6
03-gen-06 7
04-gen-06 5
05-gen-06 6
06-gen-06 7
07-gen-06 6
08-gen-06 5
09-gen-06 4
10-gen-06 5
11-gen-06 6
12-gen-06 7
13-gen-06 6
14-gen-06 5
15-gen-06 5
........

Any tips will be very helpful!!!!

Davide Ambrosini
Italy
 
B

Bob Phillips

In C6: =AVERAGE(B2:B6)

and copy down.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
A

ambrosinid

tnks for your post!
but what i need is moving average, not simple average!

ie: if you have a serie of data (a,b,c,d,e), average = (a+b+c+d+e)/5;
when you add at the serie the letter f and take out a, average
=(b+c+d+e+f)/5 ..... and so on you calculate moving average
 
P

Pete_UK

If you copy Bob's formula down column C from C6, then in C7 it will
become:

=AVERAGE(B3:B7)

and in C8:

=AVERAGE(B4:B8)

and so on, giving you a moving average of the previous 5 values in
column B - this is what you wanted, wasn't it?

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top