Download the example workbook
This tutorial will demonstrate how to calculate the number of months between two dates in Excel & Google Sheets.
Number of Months Between Dates
To calculate the number of months between dates you can use the DATEDIF Function:
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:
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 "
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.
Number of Months Between Dates in Google Sheets
All of the above examples work exactly the same in Google Sheets as in Excel.