View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Excel Date Display?

On Sat, 17 May 2008 12:31:01 -0700, daddylonglegs
wrote:

Hello Ron,

For the 3 examples you gave Mike's formula gives me 29, 28 and 1 day
respectively which appear to me to be correct, although I think you get odd
results if start date is 31st January and end date 1st March.....in which
case try this formula


Those are odd results, since I get something quite different. Something
strange is going on.

Obviously you didn't copy and paste your results, since Mike's formula gives a
string.

Here is what I get -- copied and pasted:

A B C
31-Jan-2008 29-Feb-2008 0 years 0 months 27 days
31-Jan-2007 28-Feb-2007 0 years 0 months 25 days
29-Feb-2008 1-Mar-2008 0 years 0 months 3 days

With Mike's formula, also copied and pasted (but dragged down from C1):

=DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&
" months "&DATEDIF(A1,B1,"md")&" days"

It'll be very interesting if this function gives different results in different
versions of Excel. I'm using Excel 2007

I think you get odd results if start date is 31st January and end date 1st March


Here's what I get using Mike's formula:

31-Jan-2008 1-Mar-2008 0 years 1 months 1 days

That seems like a perfectly reasonable answer. And it is also the same as the
answer I get using your formula.

--ron