years and months

A

asua09

hi

How do i display 17 as 1 year 5 months, 26 months as 2 years 2months
etc etc

thanks for any help
 
J

JE McGimpsey

One way:

=INT(A1/12) & IF(INT(A1/12)<>1," years "," year ") & MOD(A1,12) &
IF(MOD(A1,12)<>1," months"," month")
 
A

asua09

thanks but how can i cope with neg numbers

-3 will not shows as 3 months (Pef in red font)
 
J

JE McGimpsey

One way:

=INT(ABS(A1)/12) & IF(INT(ABS(A1)/12)<>1," years "," year ") &
MOD(ABS(A1),12) &IF(MOD(ABS(A1),12)<>1," months"," month")

Use conditional to make the font red if A1 is negative:

CF1: Formula is =A1<0
Format: Font->Red
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top