Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default 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 ?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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 ?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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 ?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dates problem mita Excel Discussion (Misc queries) 4 June 2nd 06 12:19 PM
Dates Problem nicole0904 Excel Discussion (Misc queries) 5 May 10th 06 02:47 PM
Problem with dates Andibevan Excel Discussion (Misc queries) 1 December 1st 05 01:24 PM
Problem Dates Andy Cohen Excel Discussion (Misc queries) 1 September 16th 05 01:29 AM
Problem with dates Emece Excel Worksheet Functions 7 December 22nd 04 06:47 PM


All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"