View Single Post
  #1   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 30 Mar 2005 11:04:57 -0600, "M Smith" wrote:

I need help using the date function in an if statement. I want cell A1 to
display a date 30 days ahead of the date typed into cell B1. I got this to
work using the Date funtion in cell A1. =DATE(YEAR(B1), MONTH(B1),
DAY(B1)+30)
However, if cell B1 is blank, I want cell A1 to be blank. If I use the
formula above cell A1 displays "1/30/1900". I tried using an if statement
but it bombs because of the commas in the DATE function
=IF(B1="","DATE(YEAR(B1), MONTH(B1), DAY(B1)+30)",""). Can anyone help me
with this.

I'm using Excel 2000 on Windows 2000.

Thanks


In A1, use this formula:

=IF(B1="","",B1+30)

Format as a date.


--ron