Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Averaging a Moving Range of values

I have some formulas that average the last 12 months of data. As new data
comes in the formula changes to reflect the change in the range. This all
works. The question is - am I doing it the "Best" way ? I figure out what
column I need to start with and what column I need to end with and I build a
string for the range then use the Indirect function. As I said, it works,
but I'm wondering if there is a simpler approach. As an additional twist,
besides the last 12 months I do the last 6 months and the last 3 months and
the same formula works for all 3 - by just pointing to a cell which contains
the number of months. Thanks for any help on this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Averaging a Moving Range of values

The easiest way to average a moving range is to stop it from moving.

Rather than inserting new data on the right-hand side of the worksheet,
insert a new blank column in column A, pushing the old data to the right.
Then insert the latest data in column A.

=AVERAGE(A1:M1) won't need constant adjustment.
--
Gary''s Student - gsnu200846


"dhstein" wrote:

I have some formulas that average the last 12 months of data. As new data
comes in the formula changes to reflect the change in the range. This all
works. The question is - am I doing it the "Best" way ? I figure out what
column I need to start with and what column I need to end with and I build a
string for the range then use the Indirect function. As I said, it works,
but I'm wondering if there is a simpler approach. As an additional twist,
besides the last 12 months I do the last 6 months and the last 3 months and
the same formula works for all 3 - by just pointing to a cell which contains
the number of months. Thanks for any help on this.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Averaging a Moving Range of values

On the one hand, that's a clever idea. On the other hand, this is an
existing workbook that I'm modifying for a friend's business. He's used to
seeing data from left to right with the most recent month followed by the
averages. So I won't be able to change the layout, and as I've said, what I
have is working and I'm just looking for another, perhaps better way of doing
the averages. But thanks for the response.

David

"Gary''s Student" wrote:

The easiest way to average a moving range is to stop it from moving.

Rather than inserting new data on the right-hand side of the worksheet,
insert a new blank column in column A, pushing the old data to the right.
Then insert the latest data in column A.

=AVERAGE(A1:M1) won't need constant adjustment.
--
Gary''s Student - gsnu200846


"dhstein" wrote:

I have some formulas that average the last 12 months of data. As new data
comes in the formula changes to reflect the change in the range. This all
works. The question is - am I doing it the "Best" way ? I figure out what
column I need to start with and what column I need to end with and I build a
string for the range then use the Indirect function. As I said, it works,
but I'm wondering if there is a simpler approach. As an additional twist,
besides the last 12 months I do the last 6 months and the last 3 months and
the same formula works for all 3 - by just pointing to a cell which contains
the number of months. Thanks for any help on this.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Averaging a Moving Range of values

Is there *always* 12 numbers to average?

Assuming the data is in a contiguous range:

=AVERAGE(OFFSET(A1,,COUNT(A1:Z1)-1,,-12))

--
Biff
Microsoft Excel MVP


"dhstein" wrote in message
...
On the one hand, that's a clever idea. On the other hand, this is an
existing workbook that I'm modifying for a friend's business. He's used
to
seeing data from left to right with the most recent month followed by the
averages. So I won't be able to change the layout, and as I've said, what
I
have is working and I'm just looking for another, perhaps better way of
doing
the averages. But thanks for the response.

David

"Gary''s Student" wrote:

The easiest way to average a moving range is to stop it from moving.

Rather than inserting new data on the right-hand side of the worksheet,
insert a new blank column in column A, pushing the old data to the right.
Then insert the latest data in column A.

=AVERAGE(A1:M1) won't need constant adjustment.
--
Gary''s Student - gsnu200846


"dhstein" wrote:

I have some formulas that average the last 12 months of data. As new
data
comes in the formula changes to reflect the change in the range. This
all
works. The question is - am I doing it the "Best" way ? I figure out
what
column I need to start with and what column I need to end with and I
build a
string for the range then use the Indirect function. As I said, it
works,
but I'm wondering if there is a simpler approach. As an additional
twist,
besides the last 12 months I do the last 6 months and the last 3 months
and
the same formula works for all 3 - by just pointing to a cell which
contains
the number of months. Thanks for any help on this.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Averaging a Moving Range of values

Thanks for the reply. The first cell is not always "A1". The data starts in
D5 so at one time, 12 months was D5:O5. The next month the 12 months was
E5:P5, then F5:Q5 etc.

"T. Valko" wrote:

Is there *always* 12 numbers to average?

Assuming the data is in a contiguous range:

=AVERAGE(OFFSET(A1,,COUNT(A1:Z1)-1,,-12))

--
Biff
Microsoft Excel MVP


"dhstein" wrote in message
...
On the one hand, that's a clever idea. On the other hand, this is an
existing workbook that I'm modifying for a friend's business. He's used
to
seeing data from left to right with the most recent month followed by the
averages. So I won't be able to change the layout, and as I've said, what
I
have is working and I'm just looking for another, perhaps better way of
doing
the averages. But thanks for the response.

David

"Gary''s Student" wrote:

The easiest way to average a moving range is to stop it from moving.

Rather than inserting new data on the right-hand side of the worksheet,
insert a new blank column in column A, pushing the old data to the right.
Then insert the latest data in column A.

=AVERAGE(A1:M1) won't need constant adjustment.
--
Gary''s Student - gsnu200846


"dhstein" wrote:

I have some formulas that average the last 12 months of data. As new
data
comes in the formula changes to reflect the change in the range. This
all
works. The question is - am I doing it the "Best" way ? I figure out
what
column I need to start with and what column I need to end with and I
build a
string for the range then use the Indirect function. As I said, it
works,
but I'm wondering if there is a simpler approach. As an additional
twist,
besides the last 12 months I do the last 6 months and the last 3 months
and
the same formula works for all 3 - by just pointing to a cell which
contains
the number of months. Thanks for any help on this.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Averaging a Moving Range of values

Ok, just change the "anchor cell" :

=AVERAGE(OFFSET(D5,,COUNT(D5:?5)-1,,-12))

Where ? is the last column of the range. ? should be big enough to allow for
future data entry. For example:

=AVERAGE(OFFSET(D5,,COUNT(D5:AX5)-1,,-12))

That gives you a total of 47 cells.


--
Biff
Microsoft Excel MVP


"dhstein" wrote in message
...
Thanks for the reply. The first cell is not always "A1". The data starts
in
D5 so at one time, 12 months was D5:O5. The next month the 12 months was
E5:P5, then F5:Q5 etc.

"T. Valko" wrote:

Is there *always* 12 numbers to average?

Assuming the data is in a contiguous range:

=AVERAGE(OFFSET(A1,,COUNT(A1:Z1)-1,,-12))

--
Biff
Microsoft Excel MVP


"dhstein" wrote in message
...
On the one hand, that's a clever idea. On the other hand, this is an
existing workbook that I'm modifying for a friend's business. He's
used
to
seeing data from left to right with the most recent month followed by
the
averages. So I won't be able to change the layout, and as I've said,
what
I
have is working and I'm just looking for another, perhaps better way of
doing
the averages. But thanks for the response.

David

"Gary''s Student" wrote:

The easiest way to average a moving range is to stop it from moving.

Rather than inserting new data on the right-hand side of the
worksheet,
insert a new blank column in column A, pushing the old data to the
right.
Then insert the latest data in column A.

=AVERAGE(A1:M1) won't need constant adjustment.
--
Gary''s Student - gsnu200846


"dhstein" wrote:

I have some formulas that average the last 12 months of data. As
new
data
comes in the formula changes to reflect the change in the range.
This
all
works. The question is - am I doing it the "Best" way ? I figure
out
what
column I need to start with and what column I need to end with and I
build a
string for the range then use the Indirect function. As I said, it
works,
but I'm wondering if there is a simpler approach. As an additional
twist,
besides the last 12 months I do the last 6 months and the last 3
months
and
the same formula works for all 3 - by just pointing to a cell which
contains
the number of months. Thanks for any help on this.






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
Averaging all values for each hour??? Jennifer Excel Discussion (Misc queries) 12 March 30th 10 06:05 PM
averaging less than values JD New Users to Excel 1 September 10th 08 04:28 AM
averaging less than values JD New Users to Excel 4 August 28th 08 07:42 PM
Averaging last 25 non zero values. [email protected] Excel Discussion (Misc queries) 2 December 10th 07 01:16 PM
Averaging selected values Hellion Excel Worksheet Functions 3 July 4th 05 03:29 AM


All times are GMT +1. The time now is 12:55 PM.

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

About Us

"It's about Microsoft Excel"