Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
Adding XY days to date in cells | Excel Discussion (Misc queries) | |||
Another Date issue. | Excel Worksheet Functions | |||
Date Math Problem | Excel Worksheet Functions | |||
Need help troubleshooting an array formula XLXP on Win2K | Excel Worksheet Functions |