counting months

jpchado

New Member
Joined
Sep 11, 2002
Messages
1
I need to count the number of months that have passed since a certain date. Is there a way to achieve this in a formula? Ex. From 1/1/01 to 6/1/02 17 months have passed.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
The Excel version of DATEDIF returns the number of whole months. That's why you get an 8. That's also why the DATE.DIFF may be more flexible.
 
Upvote 0
the following formula:

=IF(MONTH(A1)>=MONTH(A2),MONTH(A2-A1),((YEAR(A2)-YEAR(A1))*12)+MONTH(A2-A1))

will also return the value you want, as well as the value for, say, 12/31/01 and 9/30/02.

or for 1/1/01 to 12/31/01, it will return the value of 12 months instead of 11, as the datedif formula does. depends on what you want i guess.

HTH
kevin
 
Upvote 0
On 2002-09-12 13:08, lenze wrote:
The Excel version of DATEDIF returns the number of whole months. That's why you get an 8. That's also why the DATE.DIFF may be more flexible.

I think they behave similarly...

=DATE.DIFF(A1,B1,3)

which gives a result like

0 an 8 mois 30 jours (yes, it's French!)

is much shorter than an equivalent DATEDIF formula.
 
Upvote 0

Forum statistics

Threads
1,217,756
Messages
6,138,425
Members
450,136
Latest member
Tabako1960

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