How do I calculate the number of months between dates in Google Sheets?

To calculate the number of months between two dates in Google Sheets, use the MONTH function. This function subtracts the start date from the end date and then divides the result by the number of days in a month. The result is the number of months between the two dates. For example, if the start date is 1/1/2020 and the end date is 7/15/2020, the formula would be =MONTH(7/15/2020,1/1/2020). This would return 6, indicating that there are 6 months between the two dates.


You can use the following formulas to calculate the number of months between two dates in Google Sheets:

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 Google Sheets:

calculate months between two dates in Google Sheets

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 Google Sheets:

calculate fractional months between dates in Google Sheets

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 Google Sheets .

The following tutorials explain how to perform other common operations in Google Sheets:

x