Count, number of entries of a particular month.

G

Guest

Hi,

On Column A, say, rows A1:A100 has different dates. How can I count the
number of rows that are dated for the month of April 2007?

Please help.
 
T

T. Valko

To count for the specific month *and* year:

=SUMPRODUCT(--(TEXT(A1:A100,"mmm yyyy")="Apr 2007"))

To count for the month of *any* year:

=SUMPRODUCT(--(MONTH(A1:A100)=4))

If there might be empty cells within the range and you want to count for the
month of January then you need to add a test because empty cells will
evaluate as month number 1:

=SUMPRODUCT(--(ISNUMBER(A1:A100)),--(MONTH(A1:A100)=1))

Biff
 
G

Guest

Thanks a lot!

T. Valko said:
To count for the specific month *and* year:

=SUMPRODUCT(--(TEXT(A1:A100,"mmm yyyy")="Apr 2007"))

To count for the month of *any* year:

=SUMPRODUCT(--(MONTH(A1:A100)=4))

If there might be empty cells within the range and you want to count for the
month of January then you need to add a test because empty cells will
evaluate as month number 1:

=SUMPRODUCT(--(ISNUMBER(A1:A100)),--(MONTH(A1:A100)=1))

Biff
 

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