Hello, I'm trying to convert decimals into feet and inches. I have this formula, =INT(D5) & " ft " & TEXT(MOD(D5,1)*12, "0, #/##") & " in", however, the results are often in fractions that are not common like the 1/32", 1/64", 1/8", 1/4" & 1/2" fractions. Is there a way I can modify this formula so that the fractions are presented in more common construction fractional units?
Regrettably, I'm unable to use the XL2BB. It seems that Excel is preventing the macro from functioning, as the functions are grayed out and cannot be used.
Thanks for taking the time to review & I appreciate all your assistance. Thanks in advance.
Following from my previous post, I think this may be useful to you.
Excel formula for convert feet-inches to decimal value, and
Excel formula for convert decimal value to feet-inches, vice versa.
Just plain Excel formulas (no VBA) for quick convert from decimal to Imperial feet-inches, and vice versa
when I do B.O.M./ schedule for my drawings, or share workbook to ppl don't use VBA (like my boss and my co-worker, Mac users)
Strongly recommend but not require to define "Excel Name" to hold conversion factors such as:
in=1 (default inch if not specify)
ft=1/12
yd=1/36
mi=1/63360 (mile)
mm=25.4
cm=2.54
m=0.0254
...
LAMBDA function for convert Imperial feet-inches (in various formats)
to decimal value, with optional argument conversion to-factor [cFact].
UDF/ Excel Name: todec()
Excel Formula:
=LAMBDA(imperial,[cFact],
LET(si,IF(LEFT(imperial,1)="-",-1,1),
ft,IFERROR(ABS(VALUE(LEFT(imperial,(FIND("'",imperial)-1)))),0),
in,TRIM(SUBSTITUTE(SUBSTITUTE(IFERROR(RIGHT(imperial,LEN(imperial)-FIND("'",imperial)),imperial),"-",""),"""","")),
si*(ft*12+VALUE(IF(ISERR(AND(FIND(" ",in),FIND("/",in))),IFERROR(VALUE("0 "&in),in),in)))/IF(ISOMITTED(cFact),1,1/cFact))
)
LAMBDA function for convert decimal value to imperial architectural format,
with optional argument conversion from-factor [cFact] with fixed 1/64 round-off.
UDF/ Excel Name: toimpa()
Excel Formula:
=LAMBDA(decimal,[cFact],
LET(si,IF(LEFT(decimal,1)="-",-1,1),
rd,1/64,
cf,IF(ISOMITTED(cFact),1,cFact),
IF(NOT(ISNUMBER(decimal)),"n/a",
IF(OR(MROUND(decimal/cf,si*rd)>=12,MROUND(decimal/cf,si*rd)<=-12),
ROUNDDOWN(MROUND(decimal/cf,si*rd)/12,0)&"'-"&TEXT(MOD(MROUND(ABS(decimal/cf),rd),12),"0 #/####")&"""",
TEXT(MROUND(decimal/cf,si*rd),"# #/####")&"""")))
)
In addition, here are some test/experiment functions, these will work with imperial array:
Note that these functions use UDF/ Excel Name todec() and toimpa() functions from above.
UDF/Excel Name: sumtoimpa() - Similar to Excel SUM() function
Excel Formula:
=LAMBDA(imperials,toimpa(SUM(MAP(imperials,todec))))
UDF/Excel Name: sumtodec() - with optional argument convert to factor [cFact] - Similar to Excel SUM() function
Excel Formula:
=LAMBDA(imperials,[cFact],(SUM(MAP(imperials,todec))*IF(ISOMITTED(cFact),1,cFact)))
UDF/Excel Name: averageimpa() - Similar to Excel AVERAGE() function
Excel Formula:
=LAMBDA(imperials,toimpa(AVERAGE(MAP(imperials,todec))))
UDF/Excel Name: minimpa() - Similar to Excel MIN() function
Excel Formula:
=LAMBDA(imperials,toimpa(MIN(MAP(imperials,todec))))
UDF/Excel Name: maximpa() - Similar to Excel MAX() function
Excel Formula:
=LAMBDA(imperials,toimpa(MAX(MAP(imperials,todec))))
UDF/Excel Name: rangeimpa() - Similar to Excel (MAX() - MIN()) functions
Excel Formula:
=LAMBDA(imperials,toimpa(MAX(MAP(imperials,todec))-MIN(MAP(imperials,todec))))
UDF/Excel Name: largeimpa() - Similar to Excel LARGE() function
Excel Formula:
=LAMBDA(imperials,rank,toimpa(LARGE(MAP(imperials,todec),rank)))
UDF/Excel Name: smallimpa() - Similar to Excel SMALL() function
Excel Formula:
=LAMBDA(imperials,rank,toimpa(SMALL(MAP(imperials,todec),rank)))
Happy Holidays!
Phh
Some test,