count no. of dates in a column that falls on certain month & year

G

Guest

based on the subject, i have a column that contains text and dates. i need to
count how many items fall on a certain month in a certain year. all dates are
not stored as text values and the column contains blank cells too. for
example:

Colum D
10/05/05
10/06/05
11/01/05
10/05/04
(blank cell)
11/10/05

i need the output to look like this:
Month:Oct Year:2004 = 1
Month:Nov Year:2004 = 0
Month:Oct Year:2005 = 2
Month:Nov YEar:2005 = 2

help on this will greatly be appreciated! thanks in advance!
 
R

Ron Rosenfeld

based on the subject, i have a column that contains text and dates. i need to
count how many items fall on a certain month in a certain year. all dates are
not stored as text values and the column contains blank cells too. for
example:

Colum D
10/05/05
10/06/05
11/01/05
10/05/04
(blank cell)
11/10/05

i need the output to look like this:
Month:Oct Year:2004 = 1
Month:Nov Year:2004 = 0
Month:Oct Year:2005 = 2
Month:Nov YEar:2005 = 2

help on this will greatly be appreciated! thanks in advance!

In some range, let us say E1:E4, enter the first day of each month of interest:

E1: 10/1/2004
E2: 11/1/2004
E3: 10/1/2005
E4: 11/1/2005

Then in F1 enter the formula:

=TEXT(E1,"""Month:""mmm ""Year:""yyyy"" = """)&
COUNTIF($D$1:$D$6,">="&E1)-COUNTIF(
$D$1:$D$6,">"&DATE(YEAR(E1),MONTH(E1)+1,0))

and copy/drag down to F4.

It gives these results with the data you have posted:

Month:Oct Year:2004 = 1
Month:Nov Year:2004 = 0
Month:Oct Year:2005 = 2
Month:Nov Year:2005 = 2




--ron
 
H

Harlan Grove

Ron Rosenfeld wrote...
....
Then in F1 enter the formula:

=TEXT(E1,"""Month:""mmm ""Year:""yyyy"" = """)&
COUNTIF($D$1:$D$6,">="&E1)-COUNTIF($D$1:$D$6,
">"&DATE(YEAR(E1),MONTH(E1)+1,0))
....

Could be shortened a bit.

=TEXT(E1,"""Month:""mmm ""Year:""yyyy = ")&
SUMPRODUCT(--(TEXT($D$1:$D$6,"yyyymm")=TEXT(E1,"yyyymm")))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top