The DATEDIF Function
The DATEDIF function is one of several hidden Excel legacy functions. We say hidden, it’s because Excel does not suggest any of these as part of the formula drop down list, nor does it offer suggestions for the arguments as you populate them. These are functions that you need to type out yourself. Thankfully, this one is short enough, and is well worth the effort.
The DATEDIF function returns the difference between two dates. It takes three arguments:
- Start Date
- End Date
The order of the arguments might feel counterintuitive for those who calculate the difference between dates by deducting the start date from the end date, but it’s an easy mistake to fix.
The units arguments most commonly used are as follow:
“D” – whole Days
“M” – whole Months
“Y” – whole Years
Working with dates can get very complicated in Excel, and sometimes it can be useful to use a flexible function like DATEDIF in place of more manual methods. We cover working with dates extensively in our Core courses.