How to determine the number of month between 2 periods?

E

Eric

Does anyone know how to determine the number of month between 2 periods? such
as
23 Feb, 2006 and 1 Apr, 2006, it returns 2 months difference and not
counting the starting day. And always start to count Feb, 2006 and Apr, 2006.
Does anyone have any suggestion?
Thank you in advance
Eric
 
M

Mike

If I understand correctly then you want the difference between 2 dates
including the start and end date i.e. 1/1/2007 - 30/9/2007 would return 9. If
my understanding is correct then this will do it.

=(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1)+1

Note you will have to change the cell format to General after entering this.

Mike
 
J

JE McGimpsey

One place to start is

A1: 23 Feb 2006
B1: 1 Apr 2006
C1: =DATEDIF(A1,B1,"m")

However, you need to be careful when it comes to how "month" is defined.
Is 31 January 2007 to 28 February 2007 one month? or zero? (Datedif
returns 0)
 
E

Eric

Thank you for your suggestion
Eric

Mike said:
If I understand correctly then you want the difference between 2 dates
including the start and end date i.e. 1/1/2007 - 30/9/2007 would return 9. If
my understanding is correct then this will do it.

=(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1)+1

Note you will have to change the cell format to General after entering this.

Mike
 
D

David Biddulph

That's OK providing that you realise that 1/1/07 to 31/1/07 is one month,
but 31/1/07 to the following day, 1/2/07, is 2 months.
 
E

Eric

Thank everyone for suggestions
I try to ignore the day and count the month only on my approach
Thank everyone
Eric
 

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