# 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.

Note:

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“)

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

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

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

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

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

Result: READ:  How to use the Excel AND function