Forum Discussion
asrobich
May 15, 2020Copper Contributor
Problem with DATEDIF function
Hi. I'm trying to calculate the difference between two dates in Excel. I have used the DATEDIF function to do this in the past, but it doesn't seem to be working correctly this time. Instead of re...
Riny_van_Eekelen
May 15, 2020Platinum Contributor
Try formatting the result cell as General. Excel sees you are calculating with dates and thinks you want to display the result as a date as well. Dates are stored as numbers, so whatever the outcome of your formula is, it will get displayed as the date that is as many days after 1 January 1900.
By te way, DATEDIF is not needed for this kind of calculation. See attached example.
Jim92065
Dec 05, 2022Copper Contributor
I just ran across this solution and you are exactly correct. I was getting different dates in January, 1900. Formatting as General fixed it. Thanks!