ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Problem with dates (https://www.excelbanter.com/excel-worksheet-functions/157817-problem-dates.html)

Carpe Diem

Problem with dates
 
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 ?


Mike H

Problem with dates
 
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

"Carpe Diem" wrote:

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 ?



David Biddulph[_2_]

Problem with dates
 
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.
--
David Biddulph

"Carpe Diem" wrote in message
oups.com...
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 ?





All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com