+ Reply to Thread
Results 1 to 4 of 4

calculating months and years

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2010
    Posts
    39

    calculating months and years

    Guys,

    I have two cells. E4 containing a date, for instance 02/03/2013 and D4 containing another date say 01/02/2012.

    I have tried the below formula to get it to come back with the years and months in between, but it isn't:

    =IF(right(E4,4)-right(d4,4)<0,"0 Years and",(Right(e4,4)-right(d4,4)&" "&"Years and")&if(MONTH(E4)-(MONTH(D4)))<0,-(MONTH(E4)-(MONTH(D4))))&" "&"Months",(MONTH(E4)-(MONTH(D4)))&" "&"Months")

    Can any one tell me whats wrong with it?

  2. #2
    Registered User
    Join Date
    05-13-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: calculating months and years

    Guys,

    Sorted it:

    =IF(RIGHT(E4,4)-RIGHT(D4,4)<0,"0 Years and",(RIGHT(E4,4)-RIGHT(D4,4)&" "&" Years and"))&" "&IF(MONTH(E4)-(MONTH(D4))<0,"-(MONTH(E4)-(MONTH(D4)))"&" "&"Months",(MONTH(E4)-(MONTH(D4)))&" "&"Months")

  3. #3
    Forum Contributor
    Join Date
    06-26-2013
    Location
    Makati
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: calculating months and years

    Hi,

    If you want to find how many years and months between 2 dates you can use datedif formula

    try this formula..

    Please Login or Register  to view this content.
    It will return Years, month and days in between.

  4. #4
    Registered User
    Join Date
    05-13-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: calculating months and years

    Thanks,

    I'll keep that one in mind, its easier then my formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Trouble calculating age in Years and Months
    By Johnmitch93 in forum Excel General
    Replies: 3
    Last Post: 03-29-2012, 05:42 PM
  2. Calculating totals of particular months / years
    By tutelary in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2010, 08:38 PM
  3. calculating the age in years and months
    By diltselizabeth in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2009, 04:36 AM
  4. Replies: 15
    Last Post: 12-09-2006, 05:27 PM
  5. [SOLVED] calculating years/months with YEARFRAC?
    By Stilla in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-21-2006, 03:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1