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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690

ADVERTISEMENT

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.
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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.
 

Forum statistics

Threads
1,144,148
Messages
5,722,787
Members
422,458
Latest member
Muirzy

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
Top