+ Reply to Thread
Results 1 to 5 of 5

Datedif calculation not clear

  1. #1
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Datedif calculation not clear

    Hi, maybe someone can explain the datedif behaviour to me as I couldn't really find the explanations for my fairly simple problem.

    I guess it can be debatable how the start and end dates should be treated for the purpose of construction the working of the function, i.e. whether these days should be counted (including/excluding) or not; but I accept the way it is as long as it is applied consistently, like:
    (a) 1-Jan to 31-Jan = zero full months
    (b) 1-Jan to 1-Feb = one full month
    (c) 1-Jan to 28-Feb = one full month (jan but not feb)
    (d) 1-Jan to 1-Mar = two full months (jan and deb)

    So apparently the start date is counted (including) whethereas the end date is not (excluding).

    Now when I do the following:
    date1 = 31/12/2019
    date2 = 31/5/2020
    datedif gives five full months
    However, the formula gives the same result for date2 = 30/6/2020 where I would expect the result to be a full six months.

    I don't see how both results can be true if the formula calculates consistently because date2 = 31/7/2020 gives (presumably correctly) 7 full months again.
    So this raises the question which actual date the results of full six months would fall on if it's not the last day of june.

    As far as I can tell it has nothing to do with leap year treatment.
    But apparently I am missing some part of the logic/working of the function.

    Any help would be much appreciated.

    Thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Datedif calculation not clear

    Does this link shed some light ?

  3. #3
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Datedif calculation not clear

    Please read this..
    https://answers.microsoft.com/en-us/...e-cfe12bdb8ec6

    Regards.

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Datedif calculation not clear

    Hi, I had read both of these links prior to posting here but as far as I can tell it doesn't address or explain my specific issue.

    Regards

  5. #5
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Datedif calculation not clear

    The reason DATEDIF is not is Excel2016 (and maybe later) because it's almost provide the correct result
    (that's mean some result is not).

    Regards.

+ 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] DATEDIF - DATEDIF Calculation returning a negative for days or months
    By DaveBre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2015, 06:22 PM
  2. Replies: 1
    Last Post: 06-29-2015, 01:32 PM
  3. Clear cell content based on another cell calculation
    By zozo23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2012, 03:10 PM
  4. DateDif Average? Damn DateDif
    By UTCHELP in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-10-2012, 08:53 AM
  5. Replies: 7
    Last Post: 05-02-2012, 08:51 PM
  6. DateDif calculation based on cell contents
    By jhiltabidel in forum Excel General
    Replies: 8
    Last Post: 06-22-2011, 11:52 AM
  7. Datedif Calculation between to dates?
    By Ethos in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2007, 04:50 AM

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