View Single Post
  #6   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi


"JE McGimpsey" wrote in message
...
That will normally work, but note that DATEDIF assumes a month is as
long as the starting month (first argument), so if

A1: 31 January 2005
A2: 1 March 2005
A3: =DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months " &
DATEDIF(A1,B1,"Md")&" Days"

will return

0 Years 1 Months -2 Days

There really isn't any consistent workaround, since "month" is not an
exact unit.



This was a bad surprise for me - I have used DATEDIF quite often, and as I
now see, without checking it tgroughly before! How about this workaround
(days part only):

=DATEDIF(A1,B1,"MD")+(DAY(A1)DAY(B1))*MAX(0,DAY(E OMONTH(A1,0))-DAY(EOMONTH(B1,-1)))

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )





In article ,
"PC" wrote:

Possibly this will work

=DATEDIF(A1,B1,"Y")&" Years "&DATEDIF(A1,B1,"YM")&" Months
"&DATEDIF(A1,B1,"Md")&" Days"

Startdate is in A1, Enddate is in B1