This tutorial will demonstrate how to calculate the number of months between two dates in Excel & Google Sheets.

Calculate Number of Months Between Main

Number of Months Between Dates

To calculate the number of months between dates you can use the DATEDIF Function:

=DATEDIF(B3,C3,"m")

DATEDIF Month

Notice that the DATEDIF Function only counts fully completed months. It does not return a fractional value.

You can use the “md” input to calculate the number of days from the partially completed month:

=DATEDIF(B3,C3,"md")

DATEDIF MD

and you can join the results together in a string of text to display the months and days difference between the dates:

=DATEDIF(B3,C3,"m")&" Months and "&DATEDIF(B3,C3,"Md")&" Days "

DATEDIF M MD Combine

Fractional Month

Using the calculations above, you can calculate an approximate fractional month value by dividing the “md” DATEDIF function result by 30 and adding it to the first function result.

<<example =datedif(“m” + datediff(“md”)/30)

Number of Months Between Dates in Google Sheets

All of the above examples work exactly the same in Google Sheets as in Excel.

Calculate Number of Months Between Google