countif function using dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to calculate the number of entries in a column that are later than one
date and earlier than another.
This is what I thought would work, but doesn't:
=COUNTIF(M3:M158,">30/09/2007"&"<01/11/2007")
 
Try it this way:

=COUNTIF(M3:M158,">30/09/2007")- COUNTIF(M3:M158,">=01/11/2007")

Hope this helps.

Pete
 
Will not work if the month is January and if there happens to be some blank
cells
included.


--


Regards,


Peo Sjoblom
 
You're absolutely correct. For the month of January must have year included

=SUMPRODUCT(--(MONTH(M3:M158)=1),--(YEAR(M3:M158)=2007)
 
=SUM(COUNTIF(M3:M158,{">30/09/2007",">31/10/2007"})*{1,-1})
Revised for the date format

And, for the month of January :

=SUMPRODUCT(--(TEXT(M3:M45,"m/yyy")="1/2007"))
 

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