Complete the formula to calculate the number of days between two dates in cells A1 and B1.
=DATEDIF(A1, B1, [1])The unit "D" tells DATEDIF to calculate the total number of days between the two dates.
Complete the formula to calculate the number of complete months between two dates in cells A2 and B2.
=DATEDIF(A2, B2, [1])The unit "M" returns the number of complete months between the two dates.
Fix the formula to calculate the leftover days ignoring months and years between dates in A3 and B3.
=DATEDIF(A3, B3, [1])The unit "MD" returns the number of days ignoring months and years, showing leftover days.
Fill both blanks to calculate the difference in years and leftover months between dates in A4 and B4.
=DATEDIF(A4, B4, [1]) & " years and " & DATEDIF(A4, B4, [2]) & " months"
"Y" calculates full years, and "YM" calculates leftover months ignoring years.
Fill all three blanks to calculate the difference as years, months, and leftover days between dates in A5 and B5.
=DATEDIF(A5, B5, [1]) & " years, " & DATEDIF(A5, B5, [2]) & " months, and " & DATEDIF(A5, B5, [3]) & " days"
"Y" counts full years, "YM" counts full months ignoring years, and "MD" counts leftover days ignoring months and years.