Date forumla

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have been constructing a spreadsheet and have the following formula which
subtracts 6 months from the cell in A1 =DATE(YEAR(a1),MONTH(a1)-6,DAY(a1)) -
this formula works fine.

If there is no date in A1, "#VALUE!" is displayed. is there an addition part
to the above forumla that would leave the cell empty unless A1 has data in it?

thanks,
Bryan
 
=IF(A1="","",DATE(YEAR(a1),MONTH(a1)-6,DAY(a1)))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Bryan said:
Hi,

I have been constructing a spreadsheet and have the following formula which
subtracts 6 months from the cell in A1
=DATE(YEAR(a1),MONTH(a1)-6,DAY(a1)) -
 
Hi Bryan,
=DATE(YEAR(a1),MONTH(a1)-6,DAY(a1)) -
this formula works fine.

If there is no date in A1, "#VALUE!" is displayed. is there an addition part
to the above forumla that would leave the cell empty unless A1 has data in it?

Sure:

=IF(A1="","",DATE(YEAR(a1),MONTH(a1)-6,DAY(a1)))

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Running Time 5
Date converts to number when part of a formula 3
Conditional Formatting 5
IF Forumla help 3
Excel Need Countifs Formula Help 0
Excel Date Display? 8
Copy/Paste formulas in merged cells 2
Last working day of a month 12

Back
Top