Table of Contents
To calculate the number of months between two dates in Excel, you can use the DATEDIF function. This function calculates the difference between two dates in months, years, or days, and returns the result in the specified unit. The syntax for this function is =DATEDIF(start_date, end_date, unit). The start_date and end_date are the two dates for which you want to calculate the difference, and the unit can be “M” for months. This will return the number of whole months between the two dates, excluding the partial months. By using this function, you can easily determine the number of months between any two dates in Excel.
Excel: Calculate the Number of Months Between Dates
You can use the following formulas to calculate the number of months between two dates in Excel:
Formula 1: Calculate Full Months Between Two Dates
=DATEDIF(A2, B2, "M")
Formula 2: Calculate Fractional Months Between Two Dates
=DATEDIF(A2, B2, "M") + DATEDIF(A2, B2, "MD")/(365/12)
Both formulas assume that cell A2 contains the start date and cell B2 contains the end date.
The following examples show how to use each formula in practice.
Example 1: Calculate Full Months Between Two Dates
The following screenshot shows how to calculate the number of full months between a list of start and end dates in Excel:

Here’s how to interpret the output:
- There is 1 full month between 1/1/2022 and 2/4/2022.
- There are 4 full months between 1/7/2022 and 5/29/2022.
- There are 0 full months between 1/20/2022 and 2/5/2022.
And so on.
Example 2: Calculate Fractional Months Between Two Dates
The following screenshot shows how to calculate the number of fractional months between a list of start and end dates in Excel:

Here’s how to interpret the output:
- There are approximately 1.099 months between 1/1/2022 and 2/4/2022.
- There are approximately 4.723 months between 1/7/2022 and 5/29/2022.
- There are approximately 0.526 months between 1/20/2022 and 2/5/2022.
And so on.
Note #1: This formula uses 365/12 to approximate the number of days in a month. You can replace this value with 30 if you’d like to simplify the formula and make the assumption that a typical month has 30 days.
Note #2: You can find the complete documentation for the DATEDIF function in Excel .
The following tutorials explain how to perform other common operations in Excel:
Cite this article
stats writer (2024). How do you calculate the number of months between two dates in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-you-calculate-the-number-of-months-between-two-dates-in-excel/
stats writer. "How do you calculate the number of months between two dates in Excel?." PSYCHOLOGICAL SCALES, 26 Jun. 2024, https://scales.arabpsychology.com/stats/how-do-you-calculate-the-number-of-months-between-two-dates-in-excel/.
stats writer. "How do you calculate the number of months between two dates in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-you-calculate-the-number-of-months-between-two-dates-in-excel/.
stats writer (2024) 'How do you calculate the number of months between two dates in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-you-calculate-the-number-of-months-between-two-dates-in-excel/.
[1] stats writer, "How do you calculate the number of months between two dates in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How do you calculate the number of months between two dates in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
