Excel Functions Tutorials

- Date and Time Function in Excel
- Add Time in Excel
- Subtract Time in Excel
- Date Excel Function
- Date Formula in Excel
- DATEVALUE Excel Function
- DATEDIF in Excel
- Day Excel Function
- Day Excel Formula
- EDATE Excel Function
- EOMONTH
- EOMONTH in Excel
- Excel Add Months to Date
- NETWORKDAYS Excel Function
- Now Excel Function
- Time Excel Function
- TIME Formula in Excel
- Today Excel Function
- Weekday Excel Function
- WORKDAY Excel Function
- Week Number in Excel
- YEAR Function in Excel
- YEAR Formula in Excel

- Financial Functions in Excel (17+)
- Logical Functions in Excel (15+)
- TEXT Functions in Excel (29+)
- Lookup Reference in Excel (44+)
- Maths Functions in Excel (52+)
- Statistical Function in Excel (50+)
- Information Functions in Excel (5+)
- Excel Charts (48+)
- Excel Tools (98+)
- Excel Tips (178+)
- VBA (162+)

Related Courses

DATEDIf is a date function used to find the difference between two given dates, now these differences can be in years months or days, it takes two dates as an arguments and one keyword to specify which type of difference is desired for the output, the output for this function is integer and the method to use this function is as follows =DATEDIF(Start Date, End Date, Unit), however, this function is compatible with excel 2000 and previous versions of excel.

**Excel DatedIf Function (Table of Contents)**

## DATEDIF Function in Excel

The Excel DATEIF function gives the difference between the two date values in months, years or days.

4.9 (1,353 ratings)

#### The Formula used for Finding the Difference Between Two Values in Excel is Mention Below:

**DATEDIF(start_date, end_date, unit)**

- Start_date – the initial date of the period you want to calculate.
- Unit: The time unit to utilize while ascertaining the difference between two dates.
- End_date – the ending date of the period.

#### Number of Units Available for DATEDIF in Excel

**#1 – Y**(Years): Y used in a formula to find the number of complete years between beginning and end dates.**#2 – M**(Months): used in a formula to find the number of complete months between the dates.**#3 – D**(Days): D used in a formula to find the Number of days between the begin date and end date.**#4 – MD (**Days barring years and months): MD used in a formula to find the date contrast in days, disregarding months and years.**#5 – YD**(Days barring years): YD used in a formula to find the date contrast in days, disregarding years.**#6 – YM**(Months barring days and years): YM used in a formula to find the date contrast in months, disregarding days and years.

### How to use the DATEDIF Function in Excel?

Select the data to find the difference:

#### DATEDIF Function in Excel Example #1

**Number of days between the two dates**

- Use the following data to find the no. of days between 2 dates.

- Enter DATEDIF formula in the first row, use D as a unit in a formula.

- Press Enter, you will find the difference in days between the two dates

- Now if we will drag the formula, we will get the result for all the dates. Please find the same in the figure shown below.

#### DATEDIF Function in Excel Example #2

**Count the number of days ignoring years**

- Use the following data to find the no. of days ignoring years.

- Enter DATEDIF Formula in the first row, use YD as a unit in a formula.

- Press Enter, you will find the difference in days between the two dates.

- Now if we will drag the formula, we will get the result for all the dates. Please find the same in the figure shown below.

#### DATEDIF Function in Excel Example #3

**Count the number of months between the two dates**

- Use the following data to find a number of months between the two dates.

- Enter DATEDIF Formula in the first row, use M as a unit in a formula

- Press Enter, you will find the difference in days between the two dates in excel.

- Now if we will drag the formula, we will get the result for all the dates. Please find the same in the figure shown below.

#### DATEDIF Function in Excel Example #4

**Find the days excluding years and months.**

- Use the following data to find the days excluding years and months.

- Enter DATEDIF Formula in the first row, use MD as a unit in a formula

- Press Enter, you will find the difference in days between the two dates.

#### DATEDIF Function in Excel Example #5

**Find the days excluding days and years.**

- Use the following data to find the days excluding days and years

- Enter DATEDIF Formula in the first row, use YM as a unit in a formula

- Press Enter, you will find the days excluding days and years.

#### DATEDIF Function in Excel Example #6

**Find the years.**

- Use the following data to find the years between the two dates

- Enter DATEDIF Formula in the first row, use Y as a unit in a formula

- Press Enter, you will find the years between the two dates.

### Advantages of DATEDIF Function in Excel

- DATEDIF in excel is very easy to use if you find the difference between the two dates.
- If you want to find the difference between a number of days, week or month, use this formula.
- DATEDIF helps you find the difference between the six parameters.
- DATEDIF is so simple because of simplicity it can be used in many of the cases if the unit is a day, year or month.
- The user needs this function only when it requires more controls.

### Disadvantages of DATEDIF Function in Excel

- DATEDIF formula in excel supports only six types of interval or able to help to find the difference among between only six types of units.
- It cannot control so many types of units like the first day of the week.
- Sometimes this function leads to complexity if you only want to find the difference among day, month or years.
- Sometime it may lead to confusion because of so many parameters used in one formula.
- DATEDIF formula in excel only gives you the formula if you are using the correct date format.

**Things to Remember**

- For the DATEDIF formula in excel to figure months accurately, the end date should be greater than the start date; otherwise, the formula the give the error the #NUM error.
- The outcomes returned by DATEDIF and YEAR/MONTH formulas are not constantly indistinguishable in light of the fact that they work dependent on various standards. The Excel DATEDIF work restores the number of complete calendar months between the dates, while the YEAR/MONTH equation works on months’ numbers.
- Always select the correct Unit in a formula.
- Excel will not help you to give instruction to fill DATEDIF formula like other functions.
- It is also recommended that, don’t use MD as units because sometimes it gives a negative value.
- Always make sure to use data format while calculating the difference between the values.
- DATEDIF formula in excel is also useful while you are the calculating the age.
- When excel does not recognize the date given, it results in the #Value!error because excel won’t understand the data argument.

### Recommended Articles

This has been a guide to DATEDIF in Excel. Here we discuss how to use DATEDIF function along with excel examples and downloadable excel templates. You may also look at these useful functions in excel –

- Insert Calendar in Excel
- VBA Concatenate Function
- VBA DateDiff Function
- IF Formula in Excel
- Excel VBA Date Function
- Excel Insert Date
- How to Concatenate Date in Excel?
- Use DATEVALUE Function
- Use EDATE Function
- Today’s Date in Excel

- 35+ Courses
- 120+ Hours
- Full Lifetime Access
- Certificate of Completion