Thread: Date Not Null
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Mathews Paul Mathews is offline
external usenet poster
 
Posts: 84
Default Date Not Null

Hi Rick,

If you'd like to add 180 days to a particular date, one way to go would be
to set cell H6 as follows:

H6 =DATE(YEAR(A6),MONTH(A6),DAY(A6)+180)

If you'd like nothing to be displayed when cell A6 contains nothing, modify
the above formula to:

H6 =if(ISBLANK(A6),"",DATE(YEAR(A6),MONTH(A6),DAY(A6) +180))

And, finally, if you'd like to ensure that, if a date isn't entered in A6,
you get an error message:

H6
=IF(ISBLANK(A6),"",IF(ISERR(DATE(YEAR(A6),MONTH(A6 ),DAY(A6)+11)),"Invalid",DATE(YEAR(A6),MONTH(A6),D AY(A6)+11)))

Hope this helps.

Paul

"Rick_C" wrote:

Column A Row 6 is an unprotected date field (mm/dd/yyyy).
Column H Row 6 is a protected date field (mm/dd/yyyy).

When you enter a date (i.e., 01/01/2006) into A6, 180 days are added to the
date and is displayed in H6 (=A6 + 180) with the result being 06/30/2006.

When A6 is null, H6 displays 06/28/1900.

First of all, am I using the right method to add 180 days to A6.
If yes, how can I make H6 not display the odd date when A6 is null.

Thank you in advance for your assistance.

Rick