#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default moving average

If I have a column of dates (column A) which are in order but not sequential
and a corresponding column of values(column B), how can I calculate an
average for the values dating back one year from the last cell.

Column A Column B Column C
6/1/97 5 5/1=5
10/3/97 10 15/2 = 7.5
5/7/98 3 13/2 = 6.5
10/4/98 78 91/3= 30.3
etc
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default moving average

Hi!

What date format are you using?

Using the format, m/d/y I get different results: 5 - 7.5 - 6 - 40.5

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=AVERAGE(IF((A$2:A$5<=A2)*(A$2:A$5=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))),B$2:B$5))

Biff

"Hunter" wrote in message
...
If I have a column of dates (column A) which are in order but not
sequential
and a corresponding column of values(column B), how can I calculate an
average for the values dating back one year from the last cell.

Column A Column B Column C
6/1/97 5 5/1=5
10/3/97 10 15/2 = 7.5
5/7/98 3 13/2 = 6.5
10/4/98 78 91/3= 30.3
etc



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default moving average

Thanks much!!!

"Biff" wrote:

Hi!

What date format are you using?

Using the format, m/d/y I get different results: 5 - 7.5 - 6 - 40.5

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=AVERAGE(IF((A$2:A$5<=A2)*(A$2:A$5=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))),B$2:B$5))

Biff

"Hunter" wrote in message
...
If I have a column of dates (column A) which are in order but not
sequential
and a corresponding column of values(column B), how can I calculate an
average for the values dating back one year from the last cell.

Column A Column B Column C
6/1/97 5 5/1=5
10/3/97 10 15/2 = 7.5
5/7/98 3 13/2 = 6.5
10/4/98 78 91/3= 30.3
etc




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default moving average

=AVERAGE(IF((A1:A100=MAX(A1:A100)-365)*(A1:A100<=MAX(A1:A100)),B1:B100))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

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

"Hunter" wrote in message
...
If I have a column of dates (column A) which are in order but not

sequential
and a corresponding column of values(column B), how can I calculate an
average for the values dating back one year from the last cell.

Column A Column B Column C
6/1/97 5 5/1=5
10/3/97 10 15/2 = 7.5
5/7/98 3 13/2 = 6.5
10/4/98 78 91/3= 30.3
etc



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default moving average

Thanks much!!

"Bob Phillips" wrote:

=AVERAGE(IF((A1:A100=MAX(A1:A100)-365)*(A1:A100<=MAX(A1:A100)),B1:B100))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

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

"Hunter" wrote in message
...
If I have a column of dates (column A) which are in order but not

sequential
and a corresponding column of values(column B), how can I calculate an
average for the values dating back one year from the last cell.

Column A Column B Column C
6/1/97 5 5/1=5
10/3/97 10 15/2 = 7.5
5/7/98 3 13/2 = 6.5
10/4/98 78 91/3= 30.3
etc






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
Moving Weighted Average formula Ori Excel Discussion (Misc queries) 5 August 17th 06 11:03 PM
Weighted moving average Boom1 Excel Worksheet Functions 0 June 1st 06 08:47 PM
Moving Average projection? Wild Nerd Excel Worksheet Functions 6 March 21st 06 01:55 PM
30 Day Moving Average Ignoring Blank Cells ethatch Excel Worksheet Functions 2 January 17th 06 09:37 AM
Plotting moving average line on a chart Herbert Chan Charts and Charting in Excel 1 February 26th 05 08:31 PM


All times are GMT +1. The time now is 12:35 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"