Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Create a 12 month rolling average

I have a data sheet with 20 columns that represent 20 months of data (starts
at column b). Monthly data is added for each month. I want to create a
rolling average. The data starts at Row 3 and ends at row 737.

E.g. for Dec 2007, the rolling average would be Jan 2007 to Dec 2007.
e.g. for Jan 2008, the rolling average would be Feb 2007 to Jan 2008, etc,

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Create a 12 month rolling average

Assuming data for Jan07 to Aug08 will be entered in cols B to U (20 cols),
data from row3 down

Try in say, W3: =AVERAGE(OFFSET(B3,,,,12))
Copy W3 across by 20 cols to AP3, fill down as far as required
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"forest8" wrote:
I have a data sheet with 20 columns that represent 20 months of data (starts
at column b). Monthly data is added for each month. I want to create a
rolling average. The data starts at Row 3 and ends at row 737.

E.g. for Dec 2007, the rolling average would be Jan 2007 to Dec 2007.
e.g. for Jan 2008, the rolling average would be Feb 2007 to Jan 2008, etc,

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Create a 12 month rolling average

On Feb 13, 2:00*pm, forest8 wrote:
I have a data sheet with 20 columns that represent 20 months of
data (starts at column b). *Monthly data is added for each month.
*I want to create a rolling average. *The data starts at Row 3 and
ends at row 737.


Does the following work for you?

Suppose you want the rolloing average in row 2. In M2 (12th month),
enter the following:

=if(count(B3:M737)=0, "", average(B3:M737))

Copy that left through U2 (20th month).
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Create a 12 month rolling average

Hi there

Thank you both but neither of these worked.

I want this rolling average to always remain in the same column (e.g. Column
AB). As I add each month, the rolling average will change accordingly.

Thanks
J

"joeu2004" wrote:

On Feb 13, 2:00 pm, forest8 wrote:
I have a data sheet with 20 columns that represent 20 months of
data (starts at column b). Monthly data is added for each month.
I want to create a rolling average. The data starts at Row 3 and
ends at row 737.


Does the following work for you?

Suppose you want the rolloing average in row 2. In M2 (12th month),
enter the following:

=if(count(B3:M737)=0, "", average(B3:M737))

Copy that left through U2 (20th month).

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Create a 12 month rolling average

This might suffice ..

In AB3, copied down:
=AVERAGE(OFFSET(B3,,COUNT(B3:U3)-1,,-12))

The above presumes each cell within the 20 col range (B to U) will be
sequentially filled each month from left to right with numbers (there should
be no blank cells in between)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"forest8" wrote in message
...
Hi there

Thank you both but neither of these worked.

I want this rolling average to always remain in the same column (e.g.
Column
AB). As I add each month, the rolling average will change accordingly.

Thanks
J





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Create a 12 month rolling average

If there could be blank cells in-between within the 20 col range (B to U) in
the sequential fill each month from left to right

Place in AB3, array-entered, copied down:
=AVERAGE(OFFSET(B3,,MAX((B3:U3<"")*(COLUMN(B3:U3) ))-2,,-12))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Create a 12 month rolling average

Hi Max

The revised formula worked but you're correct in thinking that I do have
blank cells/columns. Unfortunately, the second formula didn't work.

J

"Max" wrote:

If there could be blank cells in-between within the 20 col range (B to U) in
the sequential fill each month from left to right

Place in AB3, array-entered, copied down:
=AVERAGE(OFFSET(B3,,MAX((B3:U3<"")*(COLUMN(B3:U3) ))-2,,-12))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Create a 12 month rolling average

What I meant to say was that I get "#Value" when I used the last formula.

J

"forest8" wrote:

Hi there

Thank you both but neither of these worked.

I want this rolling average to always remain in the same column (e.g. Column
AB). As I add each month, the rolling average will change accordingly.

Thanks
J

"joeu2004" wrote:

On Feb 13, 2:00 pm, forest8 wrote:
I have a data sheet with 20 columns that represent 20 months of
data (starts at column b). Monthly data is added for each month.
I want to create a rolling average. The data starts at Row 3 and
ends at row 737.


Does the following work for you?

Suppose you want the rolloing average in row 2. In M2 (12th month),
enter the following:

=if(count(B3:M737)=0, "", average(B3:M737))

Copy that left through U2 (20th month).

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Create a 12 month rolling average

"forest8" wrote:
What I meant to say was that I get "#Value" when I used the last formula
Place in AB3, array-entered, copied down:
=AVERAGE(OFFSET(B3,,MAX((B3:U3<"")*(COLUMN(B3:U3) ))-2,,-12))


You got the error because you didn't "array-enter" the formula
To "array-enter" means to press CTRL+SHIFT+ENTER [CSE] in confirming the
formula (instead of just pressing ENTER). If you did this confirmation
correctly, you should see Excel wrap curly braces: { } around the formula in
the formula bar. If you don't see it, click inside the formula bar and try
the CSE again.

That said, I'd suggest a tweak to the earlier array formula - that we
control/fix the range to be averaged based on the col labels row (row2)
instead of the data rows, as you may have no data for entry for a certain
current month, in which case Excel would not know that the "current" rolling
range has moved 1 col to the right.

So, assuming that you would be entering the col labels in row2 progressively
each month from left to right within the range B2:U2

Put in AB3, array-enter the formula, copied down:
=AVERAGE(OFFSET(B3,,MAX(($B$2:$U$2<"")*(COLUMN($B $2:$U$2)))-2,,-12))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Create a 12 month rolling average

It worked with CSE but I have another question:

Can I use this formula if I only want to create a rolling average based on
the 12 most recent months (even if it includes blanks)?

This formula seems to take 12 months regardless of whether it's the 12 most
recent months.

"Max" wrote:

"forest8" wrote:
What I meant to say was that I get "#Value" when I used the last formula
Place in AB3, array-entered, copied down:
=AVERAGE(OFFSET(B3,,MAX((B3:U3<"")*(COLUMN(B3:U3) ))-2,,-12))


You got the error because you didn't "array-enter" the formula
To "array-enter" means to press CTRL+SHIFT+ENTER [CSE] in confirming the
formula (instead of just pressing ENTER). If you did this confirmation
correctly, you should see Excel wrap curly braces: { } around the formula in
the formula bar. If you don't see it, click inside the formula bar and try
the CSE again.

That said, I'd suggest a tweak to the earlier array formula - that we
control/fix the range to be averaged based on the col labels row (row2)
instead of the data rows, as you may have no data for entry for a certain
current month, in which case Excel would not know that the "current" rolling
range has moved 1 col to the right.

So, assuming that you would be entering the col labels in row2 progressively
each month from left to right within the range B2:U2

Put in AB3, array-enter the formula, copied down:
=AVERAGE(OFFSET(B3,,MAX(($B$2:$U$2<"")*(COLUMN($B $2:$U$2)))-2,,-12))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



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
How to create a rolling 6 month average? anley Excel Discussion (Misc queries) 3 August 14th 06 12:41 PM
rolling 12 month average gevans Excel Worksheet Functions 5 February 21st 06 01:09 PM
Formula for calculating a rolling 12 month average in excel? Jeff Excel Discussion (Misc queries) 1 December 9th 05 09:11 PM
How do I create a rolling average chart, adding most recent data? Doug@NxEdge Charts and Charting in Excel 1 November 5th 05 02:22 AM
How can I create a rolling average between 2 values? tomcat Excel Worksheet Functions 2 January 28th 05 02:49 PM


All times are GMT +1. The time now is 09:36 AM.

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"