Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

English Units

7 views
Skip to first unread message

Hessel Flach

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
Hi,

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

patrick...@my-dejanews.com

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
Here's a function I wrote just for you:
Function English(lFeet As Long, lInches As Long) As String
Dim dTemp As Double
If lInches > 12 Then
lFeet = lFeet + Int(lInches / 12)
lInches = lInches - 12 * Int(lInches / 12)
End If
English = Format$(lFeet, "0") & "' " & Format$(lInches, "0") & """"
End Function

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

DMcRitchie

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
Hi Hessel, (posted with email copy)
Perhaps the following would work to change measurements in feet to feet and
inches. Strictly display.

=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

DMcRitchie

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
Hi Hessel, (posted with email copy)

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.

0 new messages