+ Reply to Thread
Results 1 to 6 of 6

Auto calculate no. of months given a date range.

Hybrid View

  1. #1
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117

    Auto calculate no. of months given a date range.

    Given a specific date eg. 07/05/2010 to 06/05/2011, how do we set the formula to auto calculate the months between the dates? In this example, the date will be taken as beginning of the month (ie. 01/05/2010)
    Last edited by gilbert; 07-12-2010 at 03:06 AM. Reason: Problem solved. Thanks to the forum contributors.
    Thank you in advance,
    Gilbert

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Auto calculate no. of months given a date range.

    Try:

    =DATEDIF(A1,B1,"m")

    Where A1 and B1 have start/end dates, respectively
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117

    Re: Auto calculate no. of months given a date range.

    Quote Originally Posted by NBVC View Post
    Try:

    =DATEDIF(A1,B1,"m")

    Where A1 and B1 have start/end dates, respectively
    It didn't return the correct number of months.... it only return 11 months, which if you compute manually, it should be 12 months. Is it alright to amend the formula as below :-

    =DATEDIF(A1,B1,"m")+1

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Auto calculate no. of months given a date range.

    If you want to include the start month, then yes add +1

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Auto calculate no. of months given a date range.

    See here http://www.cpearson.com/excel/datedif.aspx for a complete explanation of how the dates are counted with the DATEDIF() function...

  6. #6
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117

    Re: Auto calculate no. of months given a date range.

    Quote Originally Posted by NBVC View Post
    See here http://www.cpearson.com/excel/datedif.aspx for a complete explanation of how the dates are counted with the DATEDIF() function...
    Thank you very much for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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