Difference Between Two Dates in Months in Excel (4 Suitable Examples)

Sometimes you may need to know how many months have passed between two dates. There are multiple ways to find the difference between two dates in months in Excel. In this tutorial, you will learn 4 effective ways to get the difference between two dates in months in Excel.


Download Practice Workbook

Download the following Excel file for your practice.


4 Effective Ways to Get Difference Between Two Dates in Months in Excel

Let’s first introduce our dataset. Suppose, there are some launch dates and closing dates of some random projects. Our goal is to calculate the difference between two dates in months in Excel.

4 Effective Ways to Get Difference Between Two Dates in Months in Excel


1. Use DATEDIF Function to Find Difference Between Two Dates in Months in Excel

If you wish to calculate only the total completed months between two dates, the DATEDIF function is for you. Just follow the steps below.

Steps:

  • Type the following formula in cell D5.
=DATEDIF(B5,C5,"M")

Here, B5 stands for the launch date, C5 stands for the closing date, and M stands for month.

Using DATEDIF Function to Find Difference Between Two Dates in Months in Excel

  • Then, press ENTER key and put the Fill Handle to the rest of the required cells.

Using DATEDIF Function to Find Difference Between Two Dates in Months in Excel

Finally, here is the result.

Using DATEDIF Function to Find Difference Between Two Dates in Months in Excel

Note:

The DATEDIF function doesn’t count the running month.

Read More: How to Calculate Time Difference in Excel Between Two Dates (7 Ways)


2. Using YEARFRAC along with INT or ROUNDUP Functions

The YEARFRAC function counts the fractional year in decimal between two dates. To remove decimals, we can use INT or ROUNDUP functions. Just follow the steps below.

Steps:

  • Write down the following formula in cell D5.
=INT(YEARFRAC(B5,C5)*12)

Here, at first, the YEARFRAC function calculates the number of years in decimal format between two dates. Then, we use the INT function to convert a decimal to a whole number after multiplying by 12.

Using YEARFRAC along with INT or ROUNDUP Functions

  • Then, press the ENTER key. Drag the Fill Handle icon to the rest of the cells.

Using YEARFRAC along with INT or ROUNDUP Functions

Finally, here is the output.

Note:

We can use the ROUNDUP function instead of the INT function. The INT function only rounds off the decimal even if it is closest to a whole number. On the other hand, the ROUNDUP function returns the nearest whole number or to a fixed decimal number according to round-off rules.

Read More: How to Calculate Time Difference in Numbers (5 Easy Ways)


Similar Readings


3. Combine YEAR and MONTH Functions to Get Month-Difference Between Two Dates in Excel

Here is another effective method you can apply to get the difference between two dates in Excel. Follow the steps below to apply these functions.

Steps:

  • Copy the following formula and paste it into cell D5.
=(YEAR(C5)-YEAR(B5))*12+MONTH(C5)-MONTH(B5)

Here, at first, the YEAR function returns the difference between two dates in years. Then, after multiplying by 12, it is converted into months. Finally, it is added to the difference between two dates in months resulted by the MONTH function.

Combining YEAR & MONTH Functions

  • Then, hit the ENTER key and drag the Fill Handle all the way.

Combining YEAR & MONTH Functions

Finally, here is the output.

Read More: How to Calculate Time Difference Between Two Dates in Minutes in Excel


4. Use a Subtraction Formula with Excel MONTH Function

To find the difference between two dates, you can simply use the MONTH function with the subtraction formula. Just follow the steps below.

Steps:

  • Go to cell D5 and type the following formula.
=MONTH(C5)-MONTH(B5)

Here, the MONTH function only returns the date difference in months within a fixed year.

Using Subtraction Formula with MONTH Function

  • Press ENTER.

Finally, you will get the result.

Using Subtraction Formula with MONTH Function

Read More: How to Calculate Time Difference in Excel VBA (2 Methods)


Conclusion

In this tutorial, I have discussed 4 effective ways to get the difference between two dates in months in Excel. I hope you found this article helpful. You can visit our website ExcelDemy to learn more Excel-related content. Please, drop comments, suggestions, or queries if you have any in the comment section below.


Related Articles

Hafiz Islam
We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo