count dates

R

rabol

Hi

How do I count then rows where the date is within a certin month ?

eg:
A B C
1 xxx some text 01-01-2005
2 yyy some text 31-01-2005
3 zzz some text 01-02-2005
4 vvv some text 01-03-2005

6 Number of rows where month is 01 (2)
7 Number of rows where month is 02 (1)
8 Number of rows where month is 03 (1)

Thanks in advance.
Best
Steen
 
R

Roger Govier

One way would be
=SUMPRODUCT(--(MONTH(C1:C4)=1)) for January

You could put month numbers 1 - 12 in cells D1:D12 then enter in E1
=SUMPRODUCT(--(MONTH($C$1:$C$4)=D1))
then copy down through E2:E12

Change your range of C1:C4 to suit the larger range of data you will
undoubtedly have.
 
R

Ragdyer

Try this:

=SUMPRODUCT(--(MONTH(C1:C25)=ROW(A1)))

And copy down, where each row will be the following month.
 
R

Ragdyer

Sorry, since I suggested copying down, you'll need the absolute references:

=SUMPRODUCT(--(MONTH($C$1:$C$25)=ROW(A1)))
 

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