View Single Post
  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 15 Feb 2005 09:47:02 -0800, jenhow
wrote:

I am use the DATE.DIFF function to return the time elapsed between two dates
and the results come back in years, months, days. But not in English, the
results say
"1 an 2 mois 3 jour". Is there any way to fix this?

Thanks.


DATE.DIFF is not an Excel function.

If you are using Longre's morefunc.xll add-in, then you should address your
questions to him directly.


It might be possible to nest that user function in a SUBSTITUTE worksheet
function, though.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(DATE.DIFF(A1,A2, 3),"an","year"),"moi","month"),"jour","day")

However, this will result in months always being plural. You could certainly
test for months being equal to one, and strip off the "s" if it is.

It might be easier to use Excel's DateDif function:

=DATEDIF(A1,A2,"y")&IF(DATEDIF(A1,A2,"y")=1," yr "," yrs ")&
DATEDIF(A1,A2,"ym")&IF(DATEDIF(A1,A2,"ym")=1," month "," months ") &
DATEDIF(A1,A2,"md") & IF(DATEDIF(A1,A2,"md")=1," day", " days")



--ron