View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default Calculation between two dates

Assuming you have two connected dates in A1 and B1 (eg date of birth
and today( ) ), and two more dates in A3 and B3, the following formula
in, say, B6 will give you almost what you want:

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

- all one formula. Unfortunately, this can give return values like;

65 years, 14 months, 23 days

and I'm not sure how to correct the number of months (I've never used
DATEDIF before!)

Here's an alternative, using the same initial dates where dates in B
are later than those in A:

=TEXT((B1+B3-A1-A3)/365.25,0)&" years,
"&TEXT((MOD((B1+B3-A1-A3),365.25)),0)&" days"

and this returns values like:

66 years, 82 days

although if you use 365 days in the formula instead of 365.25 with the
same dates that I did then it would show 66 years, 98 days

Take your pick, and I hope you can make some use of them.

Pete