+ Reply to Thread
Results 1 to 3 of 3

difference between dates

  1. #1
    RGB
    Guest

    difference between dates

    Hi,

    I am using this formula to calculate the difference (in months) between two
    dates;

    =DATEDIF(A2,B2,"m")

    However there is a problem. When using the above formula the difference
    between these two dates-

    1/4/2006 - 31/3/2006

    The formual returns 11 months. This isn't correct as they are actually 364
    days apart, and the difference I need to see for my purposes is 12 months.

    Does anybody have a solution?

    Many thanks



  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064
    Erm, in your example the difference between 01/04/2006 1st April 2006 and 31/03/2006 31st march 2006 is actually 1 day!!
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Bill Ridgeway
    Guest

    Re: difference between dates

    This is a weird one.

    The difference between 01/04/2005 and 31/03/2006 (not as stated) is indeed
    364 days which should (rounded up) come to 12 months.
    Your formula does return 11.0 months so ROUNDUP wont work.

    Then, I thought it's the age-old trap of whether or not you are counting the
    first period. I've come across this trap many times. When calculating date
    differences you have to be aware whether or not you are counting the first
    period and, if necessary, add one.

    There are a number of arguments for determining when the clock 'starts'. Do
    you remember the arguments around the turn of this century. Was 01/01/2000
    or 01/01/2001? Let's not go into that one again!

    Regards.

    Bill Ridgeway
    Computer Solutions

    "RGB" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I am using this formula to calculate the difference (in months) between
    > two
    > dates;
    >
    > =DATEDIF(A2,B2,"m")
    >
    > However there is a problem. When using the above formula the difference
    > between these two dates-
    >
    > 1/4/2006 - 31/3/2006
    >
    > The formual returns 11 months. This isn't correct as they are actually 364
    > days apart, and the difference I need to see for my purposes is 12 months.
    >
    > Does anybody have a solution?
    >
    > Many thanks
    >
    >




+ 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