Convert an integer to # of years-months-days

  • Thread starter Thread starter nli10d
  • Start date Start date
N

nli10d

I need a formula that will convert a whole number to the number of
years, days and months.
It can be arrayed in 1 or 3 columns.
Example: 4142= 11 years, 4, months and 4 days (give or take a day)
 
With your integer in A1, put this in B1:

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

Hope this helps.

Pete
 
With your integer in A1, put this in B1:

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

Hope this helps.

Pete



- Show quoted text -

That's exactly what I was looking for! Thanks a million!
 
Hi. I don't know if the logic is totally correct, but this gave your
desired output...


=DATE(2000,0,4142+1)

and custom formatted as

yy "years" mm "months" dd "days"


Display:
11 years 04 months 04 days

= = = = = = = =
HTH :>)
Dana DeLouis
 
Back
Top