DATEDIF Function in Excel

Question

What is the DATEDIF function in Excel?

Answer

The DATEDIF function can be used to calculate the number of days between two dates in versions of Excel from 97 to 2010.  An interesting point about DATEDIF is that it is an undocumented function which means it is not listed with other functions under the Formulas tab in Excel 2010.  
 
To use the function you must type it manually into a cell on the worksheet rather than using the dialog box method available for other functions.  The syntax for the DATEDIF function is: = DATEDIF ( start_date , end_date , unit )  
The function has three arguments that need to be entered as part of the function:

  • start_date - the first or starting date.
  • end_date - the second or last date.
  • unit - tells the function to find the number of days (D), complete months (M), or complete years (Y) between the two dates. 

 
The unit argument can also be a combination of days, months, and years:

  • YM - excludes years - calculates the number of months between two dates as if the dates were in the same year.
  • YD - excludes years - calculates the number of days between two dates as if the dates were in the same year.
  • MD - excludes months - calculates the number of days between two dates as if the dates were in the same month and year.

For more information about Formulas and Functions in Excel, please view the full tutorial from the CTL here: Excel Part 3

If you need further assistance, please click the CTL Support Request button on this page

CTL Support Request

Details

Article ID: 7940
Created
Thu 12/29/22 1:28 PM
Modified
Fri 11/3/23 3:58 PM
KCS Article Status
WIP: Only Problem & some Environment captured
Not Validated: Complete & Resolution captured, confidence lacks in structure, content, no feedback
Validated: Complete & reusable, used by licensed KCS user, confidence in resolution & std. compliance
Validated

Related Services / Offerings (1)

The Center for Teaching & Learning develops and supports a diverse and inclusive community dedicated to excellent teaching, learning, and student educational experience regardless of location, formality, or modality.