Hi All,
I need to convert millimeters into feet and inches and round down to the nearest inch. For example: 2500 mm = 8'-2". I would like the cell to acually display the ' and ".
A bit stuck on this one.
Thanks!
Jim
Formula or Macro
Re: Formula or Macro
This appears to work for Inches to Feet and Inches.
=INT(A1/12)&"' - "&MOD(A1;12)&""""
I don't know the divisor for centimeters.
=INT(A1/12)&"' - "&MOD(A1;12)&""""
I don't know the divisor for centimeters.
Re: Formula or Macro
You can use custom format codes to add units so if A1=2500 then with a cell formula =A1/304.8format of #.0 "Ft" will display 8.2 Ft
However you can't work base 12 and you can't infix so you need a dog of a formula:
You need to do the explicit round first because you want 2' 11.888" to display as 3' 0" not 2' 0".
However you can't work base 12 and you can't infix so you need a dog of a formula:
- =INT(ROUND(A1/25.4)/12)&"'-"&MOD(ROUND(A1/25.4);12)&""""
You need to do the explicit round first because you want 2' 11.888" to display as 3' 0" not 2' 0".
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
Re: Formula or Macro
A1: value in mm (positive or negative)
[Edit: the ft-portion needs to be cut, not rounded]
B1: =CONVERT_ADD(A1/1000;"m";"ft")
C1: =INT(ABS(B1))
D1: =(ABS(B1)-C1)
E1: =CONVERT_ADD(D1;"ft";"in")
F1: =TEXT(C1*SIGN(B1);"0'")&"-"&TEXT(E1;"0""")
[Edit: the ft-portion needs to be cut, not rounded]
B1: =CONVERT_ADD(A1/1000;"m";"ft")
C1: =INT(ABS(B1))
D1: =(ABS(B1)-C1)
E1: =CONVERT_ADD(D1;"ft";"in")
F1: =TEXT(C1*SIGN(B1);"0'")&"-"&TEXT(E1;"0""")
Last edited by Villeroy on Wed Jan 23, 2008 6:32 pm, edited 2 times in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Formula or Macro
You need to do the explicit round first because you want 2' 11.888" to display as 3' 0" not 2' 0".
Actually 2' 11.888" I need to display as 2'-11"
So this should work ????
=INT(ROUND(A1/25.4)/12)&"'-"&MOD(ROUND(A1/25.4);12)&""""
Thanks!
Actually 2' 11.888" I need to display as 2'-11"
So this should work ????
=INT(ROUND(A1/25.4)/12)&"'-"&MOD(ROUND(A1/25.4);12)&""""
Thanks!
Re: Formula or Macro
What about CONVERT_ADD()? Or is that StarOffice specific?
Re: Formula or Macro
Bugger, I missed the round down bit. As long as the values are positive then JohnV's formula is more like it: =INT(A1/304.8)&"'-"&MOD(INT(A1/25.4);12)&""""JAR wrote:Actually 2' 11.888" I need to display as 2'-11"
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.