The DATEDIF Function in Excel is used to calculate the number of days, months, or years between two dates. A common error is to use “=dateif” instead of “=datedif.” This can come in handy if you need to determine how long a certain project has taken or if you bill by active days. You can use this formula as a base for other calculations.

Let’s start with the formula.



The start date and end date are self-explanatory. However, it is important to understand how to define a unit. Please refer to the table below.

Unit Return
“Y” The number of complete years
“M” The number of complete months
“D” The number of Days in a period
“MD” The difference between the start date and end date in days. Months and years are ignored
“YM” Displays the difference between the months in start date and end date. Days and years are ignored.
“YD” The difference between days of start date and end date. Years are ignored.

In the example below, we show how the Unit is used to change the calculation between dates.

Leave a Reply

INT Function

The INT function in Excel rounds a number down to the nearest integer. This function will always round down. For

Read More »

EXACT Function

The EXACT function compares two strings of text. The main limitation of using the Exact function is it is Case

Read More »
Scroll to Top