Problem with dates

C

Carpe Diem

Hi ,

I have the following dates:

31/03/2007
30/10/2006
09/12/1991

and I would like to check how many months do I have between dates, If
I use the year frac between the first and second will give 5 months
but the real value sholud be 6 . Can someone have a formula to check
this ?
 
M

Mike H

I think you need to look at your data again

=DATEDIF(A2,A1,"d")

Gives 152 days and

=DATEDIF(A2,A1,"m")

Gives the correct answer of 5 months between 30/10/2006 & 31/3/2007

Mike
 
D

David Biddulph

What formula are you using with YEARFRAC which you think is telling you a
number of months?
And where do you get the idea that any of those differences should be 6
months? 30/10/2006 to 31/03/2007 looks like just 1 day beyond 5 months
(subject to the usual questions as to how one defines a time in months when
different months have different lengths).
Are you looking for how many different calendar months you've got within the
period spanned by your start & finish dates? [So would you want 31st Jan to
1st Feb to say 2 months, but 1st Jan to 31st Jan to say 1 month?]
For some definitions of the period between the dates, DATEDIF may be more
suitable than YEARFRAC, but you'll need to define how you're measuring
things.
 

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