Function Age(Date1 As Date, Date2 As Date) As String
' attribuée à Chip Pearson's bien que non retrouvée sur son site
' http://www.cpearson.com/excel/datedif.htm
Dim Y As Integer
Dim M As Integer
Dim D As Integer
Dim Temp1 As Date
Temp1 = DateSerial(Year(Date2), Month(Date1), Day(Date1))
Y = Year(Date2) - Year(Date1) + (Temp1 > Date2)
M = Month(Date2) - Month(Date1) - (12 * (Temp1 > Date2))
D = Day(Date2) - Day(Date1)
If D < 0 Then
M = M - 1
D = Day(DateSerial(Year(Date2), Month(Date2), 0)) + D
End If
Age = Y & " an(s) " & M & " mois et " & D & " jour(s)"
End Function