Counting Dates

S

Sandy Mann

Try:

=SUMPRODUCT((MONTH(A1:A100)=1)*(YEAR(A1:A100)=2008))

Change the month number, year and range to suit.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

Shane Devenshire

Hi Mark.

Here are couple of alternatives:

=SUMPRODUCT((MONTH(A2:A37)=5)*(YEAR(A2:A37)=2008))

=SUM((A2:A37>=D3)*(A2:A37<=E3))
here you enter the first and last day of a month in the cells D3 and E3.
This formula is an array formula so you press Shift+Ctrl+Enter to enter it.

=SUMPRODUCT(--((TEXT(A2:A37,"M YY")="5 08")))
or its equivalent array version
=SUM(N((TEXT(A2:A37,"M YY")="5 08")))

All of these approaches assume the date in the range are entered as dates
not text.

Cheers,
Shane Devenshire
Microsoft Excel MVP
 

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