Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Calculate months between dates (98/2000)

    I can't work out an elegant way of accurately calculating the number of months between two date, (I can do it the long way with many columns) any ideas?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Calculate months between dates (98/2000)

    There is an undocumented function to help, called DATEDIF

    If your dates are in A1 and B1 (earliest in A1) then the following returns the number of whole months between the 2 :

    =DATEDIF(A1,B1,"m")

    Changinh "m" to "d" gives the nummber of days, and "y" the number of years etc.

    Andrew C

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculate months between dates (98/2000)

    Here's Chip Pearson's humorous documentation of DATEDIF. If you have XL2K or later, there is documentation in the help files, but it is not listed in the paste function dialog box. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Lounger
    Join Date
    May 2002
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate months between dates (98/2000)

    Wow!

    The hours, nay, days I have lost trying to do this simple task, AND IT WAS THERE ALL ALONG!

    To paraphrase W.C. Fields: "Microsoft drove me to drink, and I didn't even have the courtesy to thank them!"

    Thanks for the tip.

Posting Permissions

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