View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default counting dates using SUMPRODUCT

On Mon, 27 Jul 2009 15:52:01 -0700, Marge
wrote:

I have a column with 100 rows that will eventually contain a publication
date. Those cells are formatted as dates. Some of the cells in the column
have dates and I need to count the number of publication dates in July,
August, etc. I'm using the formula

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

[7 being the number that represents July] and the formula yields the number
of publication dates in July.

My problem is that the formula is counting every blank cell as a January
date.
Any help you can give is greatly appreciated.


Try modifying your formula for January like this:

=SUMPRODUCT((MONTH(A1:A100)=1)*(A1:A100<""))

Hope this helps / Lars-Åke