Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a way to convert decimals

Status
Not open for further replies.

imtaylor

Technical User
Feb 5, 2008
6
US

Hello all, thanks for the help. I used to have a formula that would convert decimals to inches, but I don't remember it. Would anyone have a good suggestion?

Thanks,

Taylor
 
Need more information.

Give an example of the format you have now and how you want to make it read.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
There is a formula from eng-tips.com

place in d1
=INT(C1)&"'-"&TRIM(TEXT(ROUND(MOD(C1,1)*12*16,0)/16,"# ??/??")&"""")

where c1 = 2.25 D1 will equal 2'-3"

ck1999
 


Thanks for the input. I've tried to modify the formula that ck1999 gives, but with no luck. I would like to see 2.25 to read as 2 1/4" (2.25") Some numbers I need to show as inches for certain areas in the shop.

Taylor
 


???

Decimals

There is FEET to inches or METERS to inches, for instance.

DECIMAL does not refer to a unit of measure.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
=TEXT(A1,"0"&IF(ABS(A1-ROUND(A1,0))>1/32," 0/"&CHOOSE(ROUND(MOD(A1,1)*16,0),16,8,16,4,16,8,16,2,16,8,16,4,16,8,16),"")) &""""

Where a1 = 1.5 and the formula produces 1 1/2"


[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 




FORMAT as FRACTION. Format > Cells - Number tab : FRACTION

Has NOTHING at all to do with inches!

Has to do wich converting decimal numbers to fractions.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Try this I believe it does round some number not sure what all decimals you are looking at. I think it does factors of 2 on the bottom like 1/2 1/4 1/8, 1/16ths

=INT(C1)&" "&TRIM(TEXT(ROUND(MOD(C1,1)*16,0)/16,"# ??/??")&"""")

ck1999
 
I don't think we have enough information to answer yet. Taylor - please think of all possible inputs and give examples of what you want returned.

Also, in your last post you said:
I would like to see 2.25 to read as 2 1/4" (2.25")
So which is it? Do you need 2.25 to read [COLOR=blue white]2 1/4"[/color] or will [COLOR=blue white]2.25"[/color] be acceptable?

Do you ever want to display feet? How would you want to display an input of 30.5? Are you looking for [COLOR=blue white]30.5"[/color] or [COLOR=blue white]2' 6.5"[/color] ?

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
With your value in A1 this formula will display as I think you want BUT it is text and you cannot do maths with the result.
=TEXT(A1,"# ?/?")&""" ("&TEXT(A1,"0.0")&""")"
I do not think you can do what you are after in a single cell and still do maths with it.

Regards,

Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top