PPRuNe Forums - View Single Post - years & months in excel
View Single Post
Old 6th January 2010 | 11:26
  #4 (permalink)  
DeeJayEss
 
Joined: Feb 2008
Posts: 60
Likes: 0
From: I come from the land downunder
Handy functions.

An alternative could be to keep the 43.8 number and have another cell that says something like '=LEFT(cell ref, 2) & " Years, " & (RIGHT(cell ref, 2) * 12) & " Months."'

The only issue you have here is that you cannot format the 'RIGHT(cell ref, 2) * 12' part of the code to specify a single decimal point. You could do it if you put the right(cell, 2) value into another cell and changed its format that way, or used VBA, which would be very neat and fast.

So for 43.8, the formula gives "43 Years, 9.6 Months."

I should specify this is native - there are some options out there (check this site for example) of addons for XL that can give you text and string formatting options without having to delve into the exciting world of XL VBA.

HTH, or at least gives you something else to think about.

Last edited by DeeJayEss; 6th January 2010 at 11:34. Reason: Added website
DeeJayEss is offline  
Reply