Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default 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
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
About calculate months between two date (date function) Hank Excel Discussion (Misc queries) 2 February 2nd 07 05:42 PM
any formular to deduct an amount automatically on a given date? Arif Excel Discussion (Misc queries) 1 January 15th 06 05:32 PM
Convert date to length of time in months from set date MJUK Excel Worksheet Functions 1 March 19th 05 06:31 PM
Return a date 6 months from a date in another cell Qaspec Excel Worksheet Functions 1 January 21st 05 04:59 PM
How do I calculate interest and deduct late fees based on date pa. leon New Users to Excel 1 January 6th 05 02:09 PM


All times are GMT +1. The time now is 11:04 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"