Hi Ian!
I'm assuming that you mean "if there's no entry in A1"
The standard approach to this is:
=IF(A1="","",YourFormula)
So try:
=IF(A1="","",INT((A1-DATE(YEAR(A1),MONTH(A1),1))/7)+1)
Alternative is just testing for empty cells using ISBLANK(A1).
Now to remove the assumption and cover your question as "if there is
no date in A1."
There isn't an inbuilt function for testing for a date but you can
have the following function:
Function ISADATE(MyCell As Range)
ISADATE = IsDate(MyCell)
End Function
Then:
=IF(ISADATE(A1),INT((A1-DATE(YEAR(A1),MONTH(A1),1))/7)+1,"")
But I'm not really happy with the ISADATE function because it resolves
to #NUM! for numbers outside the date range.
=IF(ISERROR(IF(ISADATE(A1),INT((A1-DATE(YEAR(A1),MONTH(A1),1))/7)+1,""
)),"",IF(ISADATE(A1),INT((A1-DATE(YEAR(A1),MONTH(A1),1))/7)+1,""))
Looks complicated but it's only using structure:
=IF(ISERROR(YourFormula),"",YourFormula)
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.