COUNTIF function with date range

  • Thread starter Thread starter Amy
  • Start date Start date
A

Amy

Is there anyway to use the COUNTIF function with a date
range. I'm trying to count each date within a particular
month. For example,

=COUNTIF(G5:G100, "12/**/03"

And this example with the wildcards is currently not
working.

Thanks. Amy
 
=SUMPRODUCT(--(MONTH(G5:G100)=12),--(YEAR(G5:G100)=2003))

or

=COUNTIF(G5:G100,">="&DATE(2003,12,1))-COUNTIF(G5:G100,">"&DATE(2003,12,31))

--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
There are 2 problems with this method, one is that if there are other years
with
December dates involved and if there are blanks,

=SUMPRODUCT(--(MONTH(G5:G100)=1))

will count blank cells as January dates


--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
Hi Peo,

Peo Sjoblom said:
if there are blanks,

=SUMPRODUCT(--(MONTH(G5:G100)=1))

will count blank cells as January dates

Didn't realize it, since I usually use both month and year. Thanks for
bringing this to my attention.
 

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

Back
Top