Does anyone know a way to display english units in Excel sheets as, for
example " 28' 6" " ? I would like to do that with a custom format, but if
someone has a macro he or she doesn't mind to share with me I would be very
happy.
Thanks a bunch in advance
Hessel Flach
It also does a conversion, eg =English(0,17) results in 1'5"
Hope it's what you need
Patrick
_________________________
In article <7fgsh1$5...@chronicle.concentric.net>,
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
=ftinches(0.3) 0' 3.6"
=ftinches(0.333) 0' 4.0"
=ftinches(0.4) 0' 4.8"
=ftinches(.5) 0' 6.0"
=ftinches(2*39.37/12)) 6' 6.7" ( 2 meters)
Function ftinches(aaa)
ftx = Int(aaa)
inx = (aaa - ftx)
inx = inx * 10 ^ (Len(aaa) - Len(inx) - 1) * 12
ftinches = ftx & "' " & Format(inx, "0.0") & """"
End Function
and maybe someday I'll figure out why the following that I miscreated first
also "appears to work" where inx is being set to a formula involving itself
-- wouldn't trust that is would continue to work, use the one above.
Function ftinches(aaa)
ftx = Int(aaa)
inx = (aaa - ftx) * 10 ^ Len(inx) * 12
ftinches = ftx & "' " & Format(inx, "0.0") & """"
End Function
HTH,
David McRitchie
My Excel Pages: http://membes.aol.com/dmcritchie/excel/excel.htm
Sorry I must have been asleep, ignore my previous answers to your question.
My function for converting feet and decimal feet to feet and inches would be:
=ftinches(6.3333) 6' 4"
=ftinches(2*39.37/12)) 6' 6.7" ( 2 meters)
Function ftinches(aaa)
'argument is in feet and fractional feet
ftx = Int(aaa)
inx = (aaa - ftx) * 12
ftinches = ftx & "' " & Format(inx, "0.0") & """"
End Function
A worksheet solution:
=INT(G11)&"' " & TEXT(12*MOD(G11,1),"0.0")&""""
Patrick Molloy's solution works on formatting supplied feet and inches. His
interpretation of the question was probably better than mine. I was thinking
more of something that would facilitate converting from metric to english.
HTH, David McRitchie
>From: "Hessel Flach" <hesse...@spinnaker.org>
>>Does anyone know a way to display english units in Excel sheets as, for
>>example " 28' 6" " ? I would like to do that with a custom format, but if
>>someone has a macro he or she doesn't mind to share with me I would be very
>>happy.