Share via

Excel 2016 DATEDIF Function Issues

Anonymous
2017-10-18T20:03:14+00:00

My DATEDIF function is returning another date as opposed to the number of days in between the specified dates.

Here's the function:   =DATEDIF(B5,C5,"d")

And here's what the function is returning (B5 and C5 are the first two cells, respectively. The third cell is the output of the above function):

6/4/2018 6/6/2018 1/2/1900

The function should be returning just thenumber two, not as a date. I've tried reformatting the date "style" of the cells to no avail. 

Here's the full grid. Maybe more examples will help show what's going on here! Thanks so much in advance for any help.

6/4/2018 6/6/2018 1/2/1900
6/7/2018 6/8/2018 1/1/1900
6/11/2018 6/15/2018 1/4/1900
6/18/2018 6/22/2018 1/4/1900
6/25/2018 6/29/2018 1/4/1900
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Duane Hookom 26,825 Reputation points Volunteer Moderator
2017-10-18T20:08:14+00:00

Mitchell, change the format of the cell to numeric so it shows the value as an integer rather than a date.

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-10-18T20:30:12+00:00

    Did you check that the cell formatting is number? It looks like you set it to date (makes sense because date is Jan 2nd 1900...).

    Please let us know.

    Thanks

    Ugo

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-10-18T20:28:29+00:00

    Hi Ugo!

    Thanks for the suggestion. I changed it to C5-B5 and the output is the same. Any other ideas you have would be greatly appreciated!

    Mitchell

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2017-10-18T20:33:48+00:00

    That worked! Thanks Duane!

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-10-18T20:14:09+00:00

    Ciao Mitchell,

    Excel provides the DATEDIF function in order to support older workbooks from Lotus 1-2-3. The DATEDIF function may calculate incorrect results under certain scenarios.

    For further information and workaround, please check this article here:

    https://support.office.com/en-us/article/DATEDI...

    If you just want the number of days in between the two dates, anyway, please try the following:

    =C5-B5

    (result, as per your example, should be 2).

    Please let us know if this solves your issue.

    Thanks

    Ugo

    Was this answer helpful?

    0 comments No comments