View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default MONTH function where cell is blank

Try:

Dates in A2 to A100

=SUMPRODUCT(--(MONTH(A2:A100)=6),--(A2:A100<""))

will count occurences of month 6 (June) for ALL years in your data

=SUMPRODUCT(--(MONTH(A2:A100)=6),(--(YEAR(A2:A100)=2007),--(A2:A100<""))

June 2007 only

SUMPRODUCT cannot have a complete column e.g. A:A, unless you have Excel 2007.

HTH

"Lmurraz" wrote:

I am trying to create a formula whic will allow me to count how many things
happened in a particular month. I have successfully got the formula to scan
the worksheet to return the month code (which I then run a second formula
across to count the occurrences). The problem I have is that when Excel
encounters a blank cell it returns a month value of "1" (I assume this is the
default date of 1-Jan-1900). How do I stop this? I would ideally like to
return a message "date not found" in this instance.

Thanks