Calculate Number of Months Between Dates in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on February 6, 2023
Download Example Workbook

Download the example workbook

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

months between dates

 

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.

=DATEDIF(B3,C3,"m")+ROUND((DATEDIF(B3,C3,"m")/30),2)&" Months"

Fractional month

 

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

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to Excel Formulas List