Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Different length moving averages

Hello;

I have several thousand data points listed consecutively in column A of my
spreadsheet. In column B, I use the AVERAGE argument to create a specific
length moving average of all points. I am running a "what-if" study to find
the optimum length moving average. Is there a way to write a macro, I so I
can just supply the length of desired moving average in the top cell of
column B, and I don't have to rewrite the AVERAGE argument each time, and cut
and paste it in every cell?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Different length moving averages

In B2:

=AVERAGE(OFFSET(A2,-$B$1+1,0,$B$1,1))

and copy it down.

The formula will return an error until you have sufficient cells for the first
average, i.e. if you specify 10 in cell B1, the formulas in B2:B9 will return
errors.

On Sun, 10 Oct 2004 21:45:07 -0700, Rick S <Rick
wrote:

Hello;

I have several thousand data points listed consecutively in column A of my
spreadsheet. In column B, I use the AVERAGE argument to create a specific
length moving average of all points. I am running a "what-if" study to find
the optimum length moving average. Is there a way to write a macro, I so I
can just supply the length of desired moving average in the top cell of
column B, and I don't have to rewrite the AVERAGE argument each time, and cut
and paste it in every cell?

Thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating moving averages.. marcus lance Excel Worksheet Functions 2 August 2nd 09 05:56 AM
moving averages fred allen Charts and Charting in Excel 1 August 26th 07 07:59 AM
How do I set up moving averages in exel Batwing New Users to Excel 0 September 28th 06 10:35 PM
Moving averages in Excel Tom Excel Discussion (Misc queries) 8 June 11th 05 02:34 AM
Different length moving averages Rick S Excel Programming 0 October 11th 04 05:43 AM


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"