Number of Months from....

StuartM1

Board Regular
Joined
Oct 6, 2010
Messages
111
Hi folks,

I do NOT have the DATEDIF function on my Excel. I'm not sure why. Anyway, how can I count the number of months as follows?

2016/11 vs. 2017/03 = 4

Any ideas??

Thanks very much!!!!!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Use the the YEAR function and the MONTH function.
Example (using format:dd/mm/yyyy):
Suppose you have the date 25/09/2007 in cell A1 and the date 31/03/2008 in cell B1 (both cells formatted as date). To calculate the number of months between these two dates you use the following formula:
=(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)
This should give a result of 6.
 
Upvote 0
DATEDIF is a hidden function.

Try =DATEDIF(A1,B1,"M")

where A1 = 11/1/2016 and B1 = 3/1/2017

Make sure that A1 and B1 are formatted as dates.
 
Upvote 0
Thank you both!

My only avail format is YYYY/MM. There is no DAY value. Just year and month.

I do not have DATEDIF function available. Can I ask what you mean by Hidden function?
 
Upvote 0
Thank you both!

My only avail format is YYYY/MM. There is no DAY value. Just year and month.

I do not have DATEDIF function available. Can I ask what you mean by Hidden function?

That's fine if your dates are formatted as YYYY/MM as long as they are seen as dates and not as text.

If they are text values, the formula will become more complicated if you refuse to change them to Excel recognized dates.

Why do you think that you do not have the DATEDIF function? It has been around since Excel 2000.

See this for more info on the function: Meet DATEDIF(), Excel’s secret Date & Time function that's still handy | PCWorld

Formula to use if they are text values: =DATEDIF(DATEVALUE(A1&"/1"),DATEVALUE(B1&"/1"),"M")
 
Last edited:
Upvote 0
Thank you! Right. That's the issue. I do not have DATEDIF.

I do NOT have =DateDif()

And YYYY/MM is not an available Date Format.

Any ideas???

Thanks in advance.
 
Upvote 0
Thank you! Right. That's the issue. I do not have DATEDIF.

I do NOT have =DateDif()

And YYYY/MM is not an available Date Format.

Any ideas???

Thanks in advance.

What version of Excel are you using? If it is Excel 2000 or newer, you DO have the DATEDIF function.

If you really don't want to use it, you can use this:

=ROUND((DATEVALUE(B1&"/1")-DATEVALUE(A1&"/1"))/30,0)

Where A1 is 2016/10 and B1 is 2017/3
 
Last edited:
Upvote 0
Awesome thanks. I will do that.
I have Office/Excel 2013 but no DateDif is available.
Thanks again very much.
 
Upvote 0
Awesome thanks. I will do that.
I have Office/Excel 2013 but no DateDif is available.
Thanks again very much.

I'm not going to argue whether or not you have the DATEDIF function.

Just know that either of these will work if you choose to use them:

=DATEDIF(DATEVALUE(A1&"/1"),DATEVALUE(B1&"/1"),"M")

=ROUND((DATEVALUE(B1&"/1")-DATEVALUE(A1&"/1"))/30,0)

You're welcome.
 
Last edited:
Upvote 0
You will not see the date datedif function or its arguments but you will get the results if you use the formula properly.
 
Upvote 0

Forum statistics

Threads
1,215,518
Messages
6,125,292
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top