Counting months between two years

S

Sarah

Hi, I am trying to be able to calculate how many months are between two
dates. I have been able to figure it out for going from a month at the
beginning of the year to a month later in the year.

[ex. 2/12/07 to 9/1/07 gives me 7, with =MONTH(B2)-MONTH(C2)]

But if i were to go from 9/1/07 to 2/12/08, it won't work.

Can anyone help me?
-Sarah
 
M

Mike H

=(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)

Will work if the year is the same or different.

Mike
 
B

bj

try =datedif(start_date, End_date,"m")
you won't find datedif in help but you will find alo if you google it.
 
S

Sarah

Thank you so much. You are amazing!

David Biddulph said:
=DATEDIF(A1,B1,"m")
--
David Biddulph

Sarah said:
Hi, I am trying to be able to calculate how many months are between two
dates. I have been able to figure it out for going from a month at the
beginning of the year to a month later in the year.

[ex. 2/12/07 to 9/1/07 gives me 7, with =MONTH(B2)-MONTH(C2)]

But if i were to go from 9/1/07 to 2/12/08, it won't work.

Can anyone help me?
-Sarah
 
D

David Biddulph

You're welcome.

For some reason known only to Mr Gates, DATEDIF() is the one function not
mentioned in Excel help.
--
David Biddulph

Sarah said:
Thank you so much. You are amazing!
David Biddulph said:
=DATEDIF(A1,B1,"m")
Sarah said:
Hi, I am trying to be able to calculate how many months are between two
dates. I have been able to figure it out for going from a month at the
beginning of the year to a month later in the year.

[ex. 2/12/07 to 9/1/07 gives me 7, with =MONTH(B2)-MONTH(C2)]

But if i were to go from 9/1/07 to 2/12/08, it won't work.

Can anyone help me?
-Sarah
 
J

James Silverton

David wrote on Tue, 5 Jun 2007 19:31:50 +0100:

DB> You're welcome.

DB> For some reason known only to Mr Gates, DATEDIF() is the
DB> one function not mentioned in Excel help.
DB> --
DB> David Biddulph

DB> ??>> Thank you so much. You are amazing!

??>> "David Biddulph" wrote:
??>>
??>>> =DATEDIF(A1,B1,"m")

Sarah! I'm sure David has seen it but you might be interested in
http://www.cpearson.com/excel/datedif.htm

Here's the beginning of the article which also gives the
possible outputs in addition to "m" for months..

The DATEDIF function is a worksheet function that computes the
difference between two dates. This function is available in all
versions of Excel since version 5, but is documented only in the
help files for Excel 2000. It isn't documented in either Excel
97 or Excel 2002. DATEDIF has, for whatever reason, been
treated as one of the drunk cousins of the Function Family.
Excel knows he lives a happy and useful existence, and will
acknowledge his existence when you ask, but will never mention
him in "polite" conversation.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.verizon.not
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top