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.
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.
- Then, press ENTER key and put the Fill Handle to the rest of the required cells.
Finally, here is the result.
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.
- Then, press the ENTER key. Drag the Fill Handle icon to the rest of the cells.
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
- How to Calculate Difference Between Two Times in Excel (8 Methods)
- Calculate Difference Between Two Rows in Pivot Table (with Easy Steps)
- How to Calculate Time Difference in Minutes in Excel (3 Easy Methods)
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.
- Then, hit the ENTER key and drag the Fill Handle all the way.
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.
- Press ENTER.
Finally, you will get the result.
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
- How to Calculate Absolute Difference between Two Numbers in Excel
- Pivot Table: Percentage Difference between Two Columns
- Excel Pivot Table: Difference between Two Columns (3 Cases)
- Calculate Positive or Negative Difference Between Two Numbers in Excel
- Excel formula to find difference between two numbers