The Excel DATEDIF function calculates the number of days, months or years between two dates, but it is known to return incorrect results in some situations.