If you happen to handle a number of tasks, you’d have a must know what number of months have handed between two dates. Or, in the event you’re within the planning part, chances are you’ll must know the identical for the beginning and finish date of a venture.

There are a number of methods to calculate the variety of months between two dates (all utilizing totally different formulation).


On this tutorial, I will provide you with some formulation that you should utilize to get the variety of months between two dates.

So let’s get began!


Utilizing DATEDIF Perform (Get Variety of Accomplished Months Between Two Dates)

It’s unlikely that you’re going to get the dates which have an ideal variety of months. It’s extra more likely to be some variety of months and a few days which might be lined by the 2 dates.

For instance, between 1 Jan 2020 and 15 March 2020, there are 2 months and 15 days.

If you happen to solely need to calculate the overall variety of months between two dates, you should utilize the DATEDIF perform.

Suppose you could have a dataset as proven under the place you solely need to get the overall variety of months (and never the times).

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Under is the DATEDIF method that may try this:

=DATEDIF(A2,B2,”M”)

DATEDIF-formula-to-get-number-of-month-between-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

DATEDIF-formula-to-get-number-of-month-between-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

The above method will provide you with solely the overall variety of accomplished months between two dates.

DATEDIF is likely one of the few undocumented capabilities in Excel. Once you kind the =DATEDIF in a cell in Excel, you wouldn’t see any IntelliSense or any steerage on what arguments it might probably take. So, in the event you’re utilizing DATEDIF in Excel, you could know the syntax.

Also Read |  Nach Baliye 9: Faisal Khan expresses his grief as he reveals he can not dance for a couple of months

In case you need to get the overall variety of months in addition to days between two dates, you should utilize the under method:

=DATEDIF(A2,B2,”M”)&”M “&DATEDIF(A2,B2,”MD”)&”D”

Use-DATEDIF-to-get-month-number-as-well-as-the-days-numbers-between-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Use-DATEDIF-to-get-month-number-as-well-as-the-days-numbers-between-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Notice: DATEDIF perform will exclude the beginning date when counting the month numbers. For instance, in the event you begin a venture on 01 Jan and it ends on 31 Jan, the DATEDIF perform will give the variety of months as zero (because it doesn’t depend the beginning date and in accordance with it solely 30 days in January have been lined)

Utilizing YEARFRAC Perform (Get Whole Months Between Two Dates)

One other methodology to get the variety of months between two specified dates is by utilizing the YEARFRAC perform.

The YEARFRAC perform will take a begin date and finish date as enter arguments and it will provide you with the variety of years which have handed throughout these two dates.

Not like the DATEDIF perform, the YEARFRAC perform will provide you with the values in decimal in case a 12 months has not elapsed between the 2 dates.

For instance, if my begin date is 01 Jan 2020 and finish date is 31 Jan 2o20, the results of the YEARFRAC perform might be zero.833. After you have the 12 months worth, you may get the month worth by multiplying this with 12.

Suppose you could have the dataset as proven under and also you need to get the variety of months between the beginning and finish date.

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Under is the method that may do that:

=YEARFRAC(A2,B2)*12

This will provide you with the months in decimals.

Also Read |  Tea-Time Snack Recipe Video: Make Tacky Biscuits Starter In Simply 15 Min With This Straightforward Recipe

YEARFRAC-function-to-get-number-of-month-in-decimal Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

YEARFRAC-function-to-get-number-of-month-in-decimal Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

In case you solely need to get the variety of full months, you may wrap the above method in INT (as proven under):

=INT(YEARFRAC(A2,B2)*12)

One other main distinction between the DATEDIF perform and YEARFRAC perform is that the YEARFRAC perform will contemplate the beginning date as part of the month. For instance, if the beginning date is 01 Jan and finish date is 31 Jan, the outcome from the above method could be 1

Under is a comparability of the outcomes you get from DATEDIF and YEARFRAC.

Difference-between-YEARFRAC-and-DATEDIF-function Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Difference-between-YEARFRAC-and-DATEDIF-function Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Utilizing the YEAR and MONTH Formulation (Depend All Months when the Venture was Lively)

If you wish to know the overall months which might be lined between the beginning and finish date, then you should utilize this methodology.

Suppose you could have the dataset as proven under:

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Data-to-calculate-months-between-two-dates Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Under is the method that will provide you with the variety of months between the 2 dates:

=(YEAR(B2)-YEAR(A2))*12+MONTH(B2)-MONTH(A2)

using-YEAR-and-MONTH-formula-to-get-the-month-count Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

using-YEAR-and-MONTH-formula-to-get-the-month-count Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

This method makes use of the YEAR perform (which supplies you the 12 months quantity utilizing the date) and the MONTH perform (which supplies you the month quantity utilizing the date).

The above method additionally fully ignores the month of the beginning date.

For instance, in case your venture begins on 01 Jan and ends on 20 Feb, the method proven under will provide you with the outcome as 1, because it fully ignores the beginning date month.

In case you need it to depend the month of the beginning date as properly, you should utilize the under method:

=(YEAR(B2)-YEAR(A2))*12+(MONTH(B2)-MONTH(A2)+1)

Chances are you’ll need to use the above method once you need to know-how in what number of months was this venture lively (which implies that it might depend the month even when the venture was lively for less than 2 days within the month).

Also Read |  DU admission 2020: Registration prolonged until July 18

So these are three alternative ways to calculate months between two dates in Excel. The tactic you select could be based mostly on what you plan to calculate (under is a fast abstract):

Use the DATEDIF perform methodology if you wish to get the overall variety of accomplished months in between two dates (it ignores the beginning date)Use the YEARFRAC methodology once you need to get the precise worth of months elapsed between tow dates. It additionally provides the lead to decimal (the place the integer worth represents the variety of full months and decimal half represents the variety of days)Use the YEAR and MONTH methodology once you need to know what number of months are lined in between two dates (even when the period between the beginning and the tip date is just a few days)

Under is how every method lined on this tutorial will depend the variety of months between two dates:

Difference-between-YEARFRAC-and-DATEDIF-and-YEAR-MONTH-function Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Difference-between-YEARFRAC-and-DATEDIF-and-YEAR-MONTH-function Calculate the Variety of Months Between Two Dates in Excel (Straightforward Formulation)

Hope you discovered this Excel tutorial helpful.

You might also like the next Excel ideas and tutorials: