Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Isaiah25
 
Posts: n/a
Default count dates within range by year and month

Column D contains a large number of rows of dates (in random order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.


  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Assuming the columns are on another sheet in A1:D1, etc

A1: test date
B1: =SUMPRODUCT(--(MONTH(Sheet1!D1:D100)=MONTH(A1))
C1:
=SUMPRODUCT(--(MONTH(Sheet1!D1:D100)=MONTH(A1),--(Sheet1!F1:F100="open"))
D1: =B1-C1

and copy down

--
HTH

Bob Phillips

"Isaiah25" wrote in message
...
Column D contains a large number of rows of dates (in random order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.




  #4   Report Post  
Isaiah25
 
Posts: n/a
Default

Don's solution worked... Thank you. I also tried Bob's and ran into an
issue when I tried to incorporate YEAR into the same logic. I have learned
from you both, and thank you both VERY MUCH for your quick responses.

Thank you.

"Isaiah25" wrote:

Column D contains a large number of rows of dates (in random order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.


  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

It would just be

=SUMPRODUCT(--(MONTH(Sheet1!D1:D100)=MONTH(A1)),--(YEAR(Sheet1!D1:D100)=Year
(A1)))

etc.

--
HTH

Bob Phillips

"Isaiah25" wrote in message
...
Don's solution worked... Thank you. I also tried Bob's and ran into an
issue when I tried to incorporate YEAR into the same logic. I have

learned
from you both, and thank you both VERY MUCH for your quick responses.

Thank you.

"Isaiah25" wrote:

Column D contains a large number of rows of dates (in random order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.






  #9   Report Post  
Isaiah25
 
Posts: n/a
Default

What I'm working with now is:

=AVERAGE(IF(MONTH('DC NAP NCT Matrix'!D$2:D$1000)=MONTH(A2)*(YEAR('DC NAP
NCT Matrix'!D$2:D$1000)=YEAR(A2),'DC NAP NCT Matrix'!S$2:SD$1000,))

where column S is the duration per case.

"Isaiah25" wrote:

Is there a way also to do a selective average based on the same data? There
is a beginning date column and an ending date column for each entry and they
want an average duration for for all cases in any given month.

"Don Guillett" wrote:

we all aim to please

--
Don Guillett
SalesAid Software

"Isaiah25" wrote in message
...
Don's solution worked... Thank you. I also tried Bob's and ran into an
issue when I tried to incorporate YEAR into the same logic. I have

learned
from you both, and thank you both VERY MUCH for your quick responses.

Thank you.

"Isaiah25" wrote:

Column D contains a large number of rows of dates (in random order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.





  #10   Report Post  
Harlan Grove
 
Posts: n/a
Default

Bob Phillips wrote...
....
=SUMPRODUCT(--(MONTH(Sheet1!D1:D100)=MONTH(A1)),
--(YEAR(Sheet1!D1:D100)=Year(A1)))

....

Alternative,

=SUMPRODUCT(--(TEXT(Sheet1!D1:D100,"YYYYMM")=TEXT(A1,"YYYYMM")))



  #11   Report Post  
Bob Phillips
 
Posts: n/a
Default

You could used this based on Harlan's idea

=AVERAGE(IF(TEXT(MONTH('DC NAP NCT
Matrix'!D2:D1000,"YYYYMM")=TEXT(A1,"YYYYMM"),MONTH ('DC NAP NCT
Matrix'!S2:S1000))

of course still an array formula

--
HTH

Bob Phillips

"Isaiah25" wrote in message
...
What I'm working with now is:

=AVERAGE(IF(MONTH('DC NAP NCT Matrix'!D$2:D$1000)=MONTH(A2)*(YEAR('DC NAP
NCT Matrix'!D$2:D$1000)=YEAR(A2),'DC NAP NCT Matrix'!S$2:SD$1000,))

where column S is the duration per case.

"Isaiah25" wrote:

Is there a way also to do a selective average based on the same data?

There
is a beginning date column and an ending date column for each entry and

they
want an average duration for for all cases in any given month.

"Don Guillett" wrote:

we all aim to please

--
Don Guillett
SalesAid Software

"Isaiah25" wrote in message
...
Don's solution worked... Thank you. I also tried Bob's and ran

into an
issue when I tried to incorporate YEAR into the same logic. I have
learned
from you both, and thank you both VERY MUCH for your quick

responses.

Thank you.

"Isaiah25" wrote:

Column D contains a large number of rows of dates (in random

order).
Column F contains a text status ("open" or "closed").

I would like to create a series of four columns:

01/2005 10 8 2
02/2005 12 9 3
03/2005 11 7 4

wherein:
the first column is the criterion for counting,
the second column is the number of entries for the target month,
the third column is the number of open cases, and
the fourth column is the number of closed cases.







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
Get count of records for a particular month and year maxtrixx Excel Discussion (Misc queries) 5 April 8th 05 07:39 PM
HELP - need to returns the current number of past month this year and ... elz64 Excel Worksheet Functions 6 April 6th 05 01:37 PM
sort dates by month and day not year dianne Excel Worksheet Functions 2 March 8th 05 08:16 PM
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 06:43 PM
How sort dates just by day/month and NOT year if all 3 given in ce smags Excel Worksheet Functions 1 January 25th 05 03:45 AM


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