Using the Excel DATEDIF Function


The DATEDIF function allows you to calculate the number of days, months, or years between two dates. When using the formula you may notice that Excel does not seem to recognize this function and will not help you fill out the arguments. The reason for this oddity is that DATEDIF was originally designed to support Lotus 1-2-3 workbooks. While the function is documented in Excel 2000, it is no longer found in the Formulas tab. However, the function will still work if you provide the inputs correctly.


=DATEDIF (start_date, end_date, unit)

Syntax Breakdown

A date that represents the start, or beginning, date in your function. For example, this could be the start of a new period at work.

When entering dates you can use text strings in quotation marks ("2018/8/14"), serial numbers (for example, 43326 would represent 2018/8/14), or you could enter the date as a formula (=DATE(2018,8,14)).

The date that will be the final, or closing, date for your function. For example, this could be the last day in a period at work.

Usage Note: If Start_date is greater than End_date the function will return a #NUM error.

Excel DATEDIF Error

The unit allows you to specify what type of data you would like returned. The options are not case sensitive and are as follows:

Excel DATEDIF Units