Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
In Column 'D' I have a list of dates in the form MMMM/YYY
Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Can anyone help? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
Maybe
=DATE(YEAR(D1),MONTH(D1)-E1,DAY(D1)) Mike "DaveMoore" wrote: In Column 'D' I have a list of dates in the form MMMM/YYY Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Can anyone help? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
On Fri, 07 Sep 2007 06:05:44 -0700, DaveMoore wrote:
In Column 'D' I have a list of dates in the form MMMM/YYY Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Can anyone help? Use this function: --- Function MonthAdd(dDate As Variant, nMonth As Variant) As Variant MonthAdd = DateAdd("m", nMonth, dDate) End Function --- In worksheet use =MONTHADD(D5,E5) This function will add months to your date, and if you want it to subtract, just call it with negative argument for month: =MONTHADD(D5,-E5) Regards, B. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
In Column 'D' I have a list of dates in the form MMMM/YYY
Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Do you really have a 3-digit year? If so, is that the format you want your answer in? Also, again assuming you really have a 3-digit year, what is the earliest year your date can have (I'm trying to see if you have to have logic to handle 19xx type years)? Rick |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
On 7 Sep, 14:05, DaveMoore wrote:
In Column 'D' I have a list of dates in the form MMMM/YYY Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Can anyone help? Thank you both Mike & Boris. Playing around I found that EOMONTH worked also Dave Moore |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
On 7 Sep, 14:42, "Rick Rothstein \(MVP - VB\)"
wrote: In Column 'D' I have a list of dates in the form MMMM/YYY Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Do you really have a 3-digit year? If so, is that the format you want your answer in? Also, again assuming you really have a 3-digit year, what is the earliest year your date can have (I'm trying to see if you have to have logic to handle 19xx type years)? Rick My mistake Rick. The format is in fact MMMM YYYY so today's date would return September 2007. Dates in my list in column 'D' are all later than the year 2000 although the result in column 'F. may well be 19xx. As mentioned in my mail that crossed with yours I used EOMONTH successfully. Thanks very much, Dave Moore |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deduct Months from a Date
Mr.Dave,
I am happy you are satisfied that EOMonth worked as well. But I notice that the results of EOMONTH and the suggestions given by Mike and Boris would be different. I am thankful that I have come to know about EOMONTH from your reply. I am a novice to formulae and programming. From Boris I would like to get one clarification . DateAdd is not defined but it is working-- how ? I do not find any excel worksheet function called Dateadd. Further, what "m" inside the brackets of dateadd indicate -- months ? Is dateadd a function of VBA ? I shall be grateful for these clarifications. Balan "DaveMoore" wrote: On 7 Sep, 14:05, DaveMoore wrote: In Column 'D' I have a list of dates in the form MMMM/YYY Column 'E' contains whole numbers which represent a no. of months In column 'F' I wish to deduct the number of months in 'E' from 'D' Can anyone help? Thank you both Mike & Boris. Playing around I found that EOMONTH worked also Dave Moore |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
About calculate months between two date (date function) | Excel Discussion (Misc queries) | |||
any formular to deduct an amount automatically on a given date? | Excel Discussion (Misc queries) | |||
Convert date to length of time in months from set date | Excel Worksheet Functions | |||
Return a date 6 months from a date in another cell | Excel Worksheet Functions | |||
How do I calculate interest and deduct late fees based on date pa. | New Users to Excel |