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

My current formula is:-
=MONTH(VLOOKUP(A1,'Y:\EWO Tracking\Mill & DSG\[Mill & DSG EWO
Tracking.xls]Mill'!$1:$65536,7,0))

This gives me the month in a numerical form. I was then going to use COUNT
or SUMPRODUCT to count the number of times a particfular month appears. The
source spreadsheet will be annual (Separate sheets per year).


"Rick Rothstein (MVP - VB)" 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.


You didn't show us your function or the range you are working with; hence,
if my guess is wrong, you will need to adjust the formula...

=IF(A1<"",MONTH(A1),"Date not found.")

Rick