Is there a formula for length?

B

Bill

I work a lot with measurements mostly in inches, but I have found a need to
convert them to feet and inches quickly, is there a macro or formula to do
this?
 
B

Biff

Hi!

There's nothing built in so you have to write your own formula. That formula
depends on the format you use. Post several examples and we'll see what we
can come up with.

Biff
 
A

Alan

Bill said:
I work a lot with measurements mostly in inches, but I have found a need to
convert them to feet and inches quickly, is there a macro or formula to do
this?


Bill, copy this function into a macro module:

Public Function ConvertFeet(ByVal Inches As Double) As String

Dim Feet As Double

Feet = Int(Inches / 12)
ConvertFeet = Str(Feet) & "'" & Str(Inches - Feet * 12) & """"

End Function

You can then address the function whenever you want within your
spreadsheet. e.g. If cell A1 contains the value 108 (inches) and you
type =convertfeet(A1) into cell A2 it will return the answer 9' 0"
 

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