Countif with date range criteria

L

luisi

I'm trying to come up with a SUMPRODUCT or COUNTIF Equation with no luck
(syntax maybe???).

I'm trying to count the nonblank cells from D2:D5000 with the following
criteria.

Month in column M (M2:M5000)=5
Year in column M (M2:M5000)=2007
 
P

Pete_UK

Assuming you have dates in column M:

=SUMPRODUCT((D2:D5000<>"")*(MONTH(M2:M5000)=5)*(YEAR(M2:M5000)=2007))

Hope this helps.

Pete
 
L

luisi

Perfect. Thanks guys, I orginally got most of it but I'm still shaky on
quotation marks and parathesis!
 
P

Pete_UK

Thanks for feeding back , Luisi.

Put each condition in brackets, and either use the double-unary -- and
separate the terms with a comma, or use the asterisk between terms as
I have.

Pete
 

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