Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Calculation Problem
I am trying to figure out how to take a date (01/01/05) in A1, and
months in A2 (the months could vary from 12 all the way up to 60)and have A3 show me the actual date format of 01/01/05 + 60 months = 01/01/10 or whatever it would be due to the leap years and all. Needs to be triggered by input from A2. Thanks in advance for any help!!!! Effective Date (A1) 01/01/05 Term in Months (A2) 60 Expiration Date (A3) ________ ************ bperks Excel 2002 USA ************ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Calculation Problem
=Date(Year(A1),Month(A1)+A2+1,0)
Would give you the end of the month =Date(Year(A1),Month(A1)+A2,1) Would give you the first of the month. -- Regards, Tom Ogilvy "bperks" wrote in message oups.com... I am trying to figure out how to take a date (01/01/05) in A1, and months in A2 (the months could vary from 12 all the way up to 60)and have A3 show me the actual date format of 01/01/05 + 60 months = 01/01/10 or whatever it would be due to the leap years and all. Needs to be triggered by input from A2. Thanks in advance for any help!!!! Effective Date (A1) 01/01/05 Term in Months (A2) 60 Expiration Date (A3) ________ ************ bperks Excel 2002 USA ************ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Calculation Problem
for a formula in a worksheet (in cell A3):
= Date(Year(A1), Month(A1)+ A2, Day(A1)) in VBA: (In the Worksheet_Change event): Select Case Target.Address Case "$A$2" Range("A3") = DateAdd("m", Range("A2"), Range("A1")) Case Else 'Do nothing End Select or, if you wanted this to trigger whenever a value in row 2 changes (not just A2): Select Case Target.Row Case 2 Target.Offset(1,0) = DateAdd("m", Target, Target.Offset(-1,0)) Case Else 'Do nothing End Select HTH, -- George Nicholson Remove 'Junk' from return address. "bperks" wrote in message oups.com... I am trying to figure out how to take a date (01/01/05) in A1, and months in A2 (the months could vary from 12 all the way up to 60)and have A3 show me the actual date format of 01/01/05 + 60 months = 01/01/10 or whatever it would be due to the leap years and all. Needs to be triggered by input from A2. Thanks in advance for any help!!!! Effective Date (A1) 01/01/05 Term in Months (A2) 60 Expiration Date (A3) ________ ************ bperks Excel 2002 USA ************ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Calculation problem | Excel Worksheet Functions | |||
Date Calculation problem | Excel Discussion (Misc queries) | |||
Date Calculation Problem | Excel Worksheet Functions | |||
Date Calculation Problem | Excel Discussion (Misc queries) | |||
Coding to show first _weekday_ prior to a date, when date calculation happens to fall on weekend? | Excel Programming |