Is there any way in excel to display feet and inches? I can get decimal feet
and even fractional feet ie. 3 1/3. Is there any way to multiply the
fraction portion of that by 12 to get it to spit out 4? Even if it ends up
in two differnet cells, I can get another cell to read 3 and the next cell to
read 4, and squash them together to look like 3'-4quot;.
Use the following formula:
=INT(A1)amp;quot;'-quot;amp;ROUND(((A1-INT(A1))*12),0) amp; CHAR(34)
Suppose you have 15.92 in cell A1, you will have 15'-11quot; from the above
formula. The formula rounds to the nearest inch.
The following one is much more complex, but it converts the decimal feet to
ft-in and fractional inch (64 based)
12.12345 ft will be converted to 12'-1 31/64quot;.
=INT(A1)amp;quot;'quot;amp;quot;-quot;amp;INT(12*(A1-INT(A1)))amp;IF((A1-INT(A1))*12-INT((A1-INT(A1))*12)gt;1/128,quot;
quot;,quot;quot;)amp;IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*64 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*64 0.5)amp;quot;/64quot;,IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*32 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*32 0.5)amp;quot;/32quot;,IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*16 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*16 0.5)amp;quot;/16quot;,quot;quot;)))
amp;IF(OR(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*64 0.5),ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*32 0.5),ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*16 0.5)),quot;quot;,IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*8 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*8 0.5)amp;quot;/8quot;,IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*4 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*4 0.5)amp;quot;/4quot;,IF(ISODD(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*2 0.5),INT(((A1-INT(A1))*12-INT((A1-INT(A1))*12))*2 0.5)amp;quot;/2quot;,quot;quot;))))amp;CHAR(34)
You can download a utility program from
www.xldatasoft.com/downloads/Conversion.xls
--
Best regards,
---
Yongjun CHEN
=================================
XLDataSoft - Data Analysis Expert, Excel/VBA Specialist
- - - - www.XLDataSoft.com - - - -
Free Excel-Based Data Processing Tool is Available for Download
Free Excel / VBA Training Materials is Available for Downloand
=================================
quot;jkragerquot; gt; wrote in message
...
gt; Is there any way in excel to display feet and inches? I can get decimal
gt; feet
gt; and even fractional feet ie. 3 1/3. Is there any way to multiply the
gt; fraction portion of that by 12 to get it to spit out 4? Even if it ends
gt; up
gt; in two differnet cells, I can get another cell to read 3 and the next cell
gt; to
gt; read 4, and squash them together to look like 3'-4quot;.
If the number of feet (3 1/3) is in a1, then =INT(A1) amp; quot;'-quot; amp; 12*MOD(A1,1) amp;
quot;quot;quot;quot;
will display as you described at the end.
--Bruce
quot;jkragerquot; wrote:
gt; Is there any way in excel to display feet and inches? I can get decimal feet
gt; and even fractional feet ie. 3 1/3. Is there any way to multiply the
gt; fraction portion of that by 12 to get it to spit out 4? Even if it ends up
gt; in two differnet cells, I can get another cell to read 3 and the next cell to
gt; read 4, and squash them together to look like 3'-4quot;.
- Jun 22 Fri 2007 20:38
display feet and inches
close
全站熱搜
留言列表
發表留言