Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA
 
Posts: n/a
Default Averages based on dates

A bit of help with a formula will be appreciated.
In column A I have start dates for a series of events and in column B are
the corresponding finish dates. Currently, 72 rows are in use but this list
will continue to grow, 4 - 8 per month. The dates are in the mm/dd/yy
format.
In column C calculated the number of elapsed weeks, =(b2-a2)/7. Formula is
copied down to the last row.
I then calculate a running average for elapsed weeks with =AVERAGE(C:C)/7

What I can not figure out is how to calculate the average elapsed weeks, for
last calendar month ( last month is based upon completion date), and to get
that to advance a month on the first of the next month. Therefore on Feb
1the average elapsed weeks should be calculated for Jan, and on Mar 1, the
calculation changes for elapsed weeks in Feb, etc.

Help will be greatly appreciated.
Paul


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Doug Glancy
 
Posts: n/a
Default Averages based on dates

Paul,

I bet there's a shorter way to do this, but it seems to work:

=SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*1)

hth,

Doug


"PA" wrote in message
...
A bit of help with a formula will be appreciated.
In column A I have start dates for a series of events and in column B are
the corresponding finish dates. Currently, 72 rows are in use but this
list
will continue to grow, 4 - 8 per month. The dates are in the mm/dd/yy
format.
In column C calculated the number of elapsed weeks, =(b2-a2)/7. Formula
is
copied down to the last row.
I then calculate a running average for elapsed weeks with
=AVERAGE(C:C)/7

What I can not figure out is how to calculate the average elapsed weeks,
for
last calendar month ( last month is based upon completion date), and to
get
that to advance a month on the first of the next month. Therefore on Feb
1the average elapsed weeks should be calculated for Jan, and on Mar 1, the
calculation changes for elapsed weeks in Feb, etc.

Help will be greatly appreciated.
Paul




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA
 
Posts: n/a
Default Averages based on dates

Thanks for the feedback, but that didnt quite work.

If I removed all the March, 06 dates, the answer should have been zero since
March is the previous month - that didnt happen
Also the calculation was off, lower, than if I just calculated the March
average using the Average function manually.
I tried both Enter and Ctrl+Shift+Enter (just in case) and got no difference.


"Doug Glancy" wrote:

Paul,

I bet there's a shorter way to do this, but it seems to work:

=SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*1)

hth,

Doug


"PA" wrote in message
...
A bit of help with a formula will be appreciated.
In column A I have start dates for a series of events and in column B are
the corresponding finish dates. Currently, 72 rows are in use but this
list
will continue to grow, 4 - 8 per month. The dates are in the mm/dd/yy
format.
In column C calculated the number of elapsed weeks, =(b2-a2)/7. Formula
is
copied down to the last row.
I then calculate a running average for elapsed weeks with
=AVERAGE(C:C)/7

What I can not figure out is how to calculate the average elapsed weeks,
for
last calendar month ( last month is based upon completion date), and to
get
that to advance a month on the first of the next month. Therefore on Feb
1the average elapsed weeks should be calculated for Jan, and on Mar 1, the
calculation changes for elapsed weeks in Feb, etc.

Help will be greatly appreciated.
Paul





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Doug Glancy
 
Posts: n/a
Default Averages based on dates

Paul,

I forgot about years. Try this:

=SUMPRODUCT((YEAR(B2:B1000)=YEAR(NOW()))*(MONTH(B2 :B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((YEAR(B2:B1000)=YEAR(NOW()))*(MONTH(B2: B1000)=MONTH(NOW())-1))

I did notice in your original post that you refer to dividing by 7 in both
Column C cells and in your overall average of Column C, but I assume that's
not really the case.

Sumproduct does not require that you enter it as an array formula (just that
my formula works!).

hth,

Doug

"PA" wrote in message
...
Thanks for the feedback, but that didnt quite work.

If I removed all the March, 06 dates, the answer should have been zero
since
March is the previous month - that didnt happen
Also the calculation was off, lower, than if I just calculated the March
average using the Average function manually.
I tried both Enter and Ctrl+Shift+Enter (just in case) and got no
difference.


"Doug Glancy" wrote:

Paul,

I bet there's a shorter way to do this, but it seems to work:

=SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*1)

hth,

Doug


"PA" wrote in message
...
A bit of help with a formula will be appreciated.
In column A I have start dates for a series of events and in column B
are
the corresponding finish dates. Currently, 72 rows are in use but this
list
will continue to grow, 4 - 8 per month. The dates are in the mm/dd/yy
format.
In column C calculated the number of elapsed weeks, =(b2-a2)/7.
Formula
is
copied down to the last row.
I then calculate a running average for elapsed weeks with
=AVERAGE(C:C)/7

What I can not figure out is how to calculate the average elapsed
weeks,
for
last calendar month ( last month is based upon completion date), and to
get
that to advance a month on the first of the next month. Therefore on
Feb
1the average elapsed weeks should be calculated for Jan, and on Mar 1,
the
calculation changes for elapsed weeks in Feb, etc.

Help will be greatly appreciated.
Paul







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PA
 
Posts: n/a
Default Averages based on dates

That is fantastic.
Thank you very much. I greatly appreciate your effort!!

"Doug Glancy" wrote:

Paul,

I forgot about years. Try this:

=SUMPRODUCT((YEAR(B2:B1000)=YEAR(NOW()))*(MONTH(B2 :B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((YEAR(B2:B1000)=YEAR(NOW()))*(MONTH(B2: B1000)=MONTH(NOW())-1))

I did notice in your original post that you refer to dividing by 7 in both
Column C cells and in your overall average of Column C, but I assume that's
not really the case.

Sumproduct does not require that you enter it as an array formula (just that
my formula works!).

hth,

Doug

"PA" wrote in message
...
Thanks for the feedback, but that didnt quite work.

If I removed all the March, 06 dates, the answer should have been zero
since
March is the previous month - that didnt happen
Also the calculation was off, lower, than if I just calculated the March
average using the Average function manually.
I tried both Enter and Ctrl+Shift+Enter (just in case) and got no
difference.


"Doug Glancy" wrote:

Paul,

I bet there's a shorter way to do this, but it seems to work:

=SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*(C2:C1000))/SUMPRODUCT((MONTH(B2:B1000)=MONTH(NOW())-1)*1)

hth,

Doug


"PA" wrote in message
...
A bit of help with a formula will be appreciated.
In column A I have start dates for a series of events and in column B
are
the corresponding finish dates. Currently, 72 rows are in use but this
list
will continue to grow, 4 - 8 per month. The dates are in the mm/dd/yy
format.
In column C calculated the number of elapsed weeks, =(b2-a2)/7.
Formula
is
copied down to the last row.
I then calculate a running average for elapsed weeks with
=AVERAGE(C:C)/7

What I can not figure out is how to calculate the average elapsed
weeks,
for
last calendar month ( last month is based upon completion date), and to
get
that to advance a month on the first of the next month. Therefore on
Feb
1the average elapsed weeks should be calculated for Jan, and on Mar 1,
the
calculation changes for elapsed weeks in Feb, etc.

Help will be greatly appreciated.
Paul










  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Averages based on dates


You could try something like this

=AVERAGE(IF(TEXT(B2:B100,"m-y")=TEXT(NOW()-DAY(NOW()),"m-y"),C2:C100))

confirmed with CTRL+SHIFT+ENTER


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=530768

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
Pre-1900 dates Richard Gadsden Excel Discussion (Misc queries) 1 March 26th 06 12:46 AM
PivotTables - Group Dates, excluding dates Todd1 Excel Discussion (Misc queries) 4 December 10th 05 05:06 PM
Counting dates for a the present month but not future months BrianInCalifornia Excel Worksheet Functions 3 December 7th 05 02:00 AM
return array result in cell based on comparing dates Ruthki Excel Worksheet Functions 7 June 30th 05 11:41 PM
How do I write a formula to color code based on dates provided or. jaime Excel Worksheet Functions 2 February 17th 05 12:41 AM


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