#1   Report Post  
Posted to microsoft.public.excel.misc
Bryan
 
Posts: n/a
Default Date forumla

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Date forumla

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

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Bryan" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
Jan Karel Pieterse
 
Posts: n/a
Default Date forumla

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?


Su

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

Regards,

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bryan
 
Posts: n/a
Default Date forumla

Bob/Jan Karel,

Thanks a lot - works perfectly!
Bryan

"Jan Karel Pieterse" wrote:

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?


Su

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

Regards,

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Adding XY days to date in cells satucha Excel Discussion (Misc queries) 1 November 25th 05 08:02 AM
Another Date issue. TimM Excel Worksheet Functions 1 November 17th 05 01:58 AM
Date Math Problem Dkline Excel Worksheet Functions 4 March 4th 05 04:11 PM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"