How to use the Excel DATEDIF function

Processing and calculating data with data is time (type date) very difficult because you can not use normal calculations. But the DATEDIF () function will help you do this, the function will help you calculate the data of the format of time in Excel.

Syntax: =DATEDIF (start_date, end_date, unit)

The DATEIF function syntax has the following arguments:

  • Start_date – This is a required argument. As the name suggests, it is the initial date of the period.
  • End_date – This is also a required argument. It represents the last, or ending, date of the period.
  • Unit – The time unit in which we want the information.


Interval Explanation
Y The number of complete years.
M The number of complete months.
D The number of days.
MD The difference between the days (months and years are ignored).
YM The difference between the months (days and years are ignored).
YD The difference between the days (years and dates are ignored).

Example: Let’s look at some Excel DATEDIF function examples and explore how to use the DATEDIF function as a worksheet function in Microsoft Excel:

1. Syntax:  =DATEDIF(B21,C21,”d“)


2. Syntax:  =DATEDIF(B21,C21,”m“)


3. Syntax:  =DATEDIF(B21,C21,”y“)


4. Syntax:  =DATEDIF(B21,C21,”md“)


5. Syntax:  =DATEDIF(B21,C21,”YM“)


6. Syntax:  =DATEDIF(B21,C21,”YD“)


Add a Comment

Your email address will not be published. Required fields are marked *