View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default is it possible to show a decimal like 142.35" as 10'-

"Ivyleaf" wrote in message
...
On Apr 6, 12:05 pm, Ron Rosenfeld wrote:
On Sun, 6 Apr 2008 09:59:04 +0900, EXCEL?NEWS

wrote:
hi,


i am using ft and in these days,


is it possible to show a decimal like 142.35" as 11'-10 1/4" in one

cell,

cell format seems impossible,any hints


thanks


Excel does not have a "feet/inches" format, but you can convert your

value into
a text string.

With your value in A1:

=INT(A1/12)&"'-"&TEXT(ROUND(MOD(A1,12)*4,0)/4,"# ??/??\""")

Note the formula is rounding to the nearest 1/4. If you need to round

to 8ths
or 16ths (or anything up to 99ths), change the "4" factor in the above

equation
accordingly.
--ron


Ron's answer should give you EXACTLY what you are after. If however,
you would like a slightly more accurate conversion on the fractional
inches part (.35 of an inch would be closer to 1/3 than 1/4 in my
book), then you can shorten Ron's formula down to:

=INT(A1/12)&"'-"&TEXT((MOD(A1,12)),"# #/#\""")

This will round to the nearest fraction with a single digit
denominator: 1/2, 1/3, 1/4, 1/5 etc.

If you want even more precision, change to:

=INT(A1/12)&"'-"&TEXT((MOD(A1,12)),"# #/##\""")

Which will allow a two digit denominator.

Cheers,
Ivan.


Hi Ivan,
What about say 0.9.
First format gives 8/9, ninth's
An interesting jazz time signature or harmonic maybe

Regards,
Peter T