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.
How to Get Difference Between Two Dates in Months in Excel: 4 Effective Ways
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.
- Type the following formula in cell D5.
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.
The DATEDIF function doesn’t count the running month.
2. Using YEARFRAC along with INT or ROUNDUP Functions
- Write down the following formula in cell D5.
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.
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.
- Calculate Time Difference Between Two Dates in Minutes in Excel
- How to Subtract Dates in Excel to Get Years
- How to Minus Number of Days or a Date from Today in Excel
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.
- Copy the following formula and paste it into cell D5.
- Then, hit the ENTER key and drag the Fill Handle all the way.
Finally, here is the output.
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.
- Go to cell D5 and type the following formula.
Here, the MONTH function only returns the date difference in months within a fixed year.
- Press ENTER.
Finally, you will get the result.
Download Practice Workbook
Download the following Excel file for your practice.
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. Please, drop comments, suggestions, or queries if you have any in the comment section below.