Decimal to inch fractions

You can choose in the cell format to show the number with a fraction on 16...

or add a presonnalized number format : #" " ??/16

But it will always show it on 16... does it matter to have 4/16 instead of 1/4?

Mat
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
If you take your original ask, all your fractional measurements given can be broken down into the common denominator which is 1/16 so unfortunately 8/16 will be shown by my suggested formula instead of the 1/2.

=INT(A1) & " " & (FLOOR(A1,1/16)-INT(A1))*16 & "/16"

As far as your extended question about two formula, breaking down the above into it's component parts should yield what you are looking for, basically the FLOOR statement rounds it down to the nearest 1/16 which yields a decimal as a multiple of a sixteenth, by multiplying by sixteen we find what that multiple is, the stuff in quotes (") is to make a text representation of a format that excel does not have as standard.

You could make this more versitile by including reference to a cell which holds the accuracy of your measuring stick, as follows

=INT(A1) & " " & (FLOOR(A1,1/F1)-INT(A1))*F1 & "/" & F1

where F1 holds that value, so to work in eighths set F1 to 8

As far as reducing the fractional part to its absolute value, ie 8/16 = 1/2 errrr I need to think about that.

Another thought would be to have 2 cells, one with FLOOR function and the other with CEILING, that would give a range of acceptable tolarances, obviously where the two cells equate to the same value so much the better, either way the error will be dependent on the accuracy of the measuring stick as shown in cell F1 above

Hope this helps.
 
Upvote 0
=INT(A1) & " " & (FLOOR(A1,1/16)-INT(A1))*16 & "/16"

That works pretty well. Is there a way for it to give me 1/2 instead of 8/16 ?
 
Upvote 0
Try:

=INT(A1/12)&" Foot " & TEXT(MOD(A1,12),"0"&IF(ABS(MOD(A1,12)-ROUND(MOD(A1,12),0))>1/32," 0/"&CHOOSE(ROUND(MOD(MOD(A1,12),1)*16,0),16,8,16,4,16,8,16,2,16,8,16,4,16,8,16),"")) & " Inches"
 
Upvote 0
Hi Davidmin:

I had a bit of play with what you are trying to do as presented in the following ...
y030923h1.xls
ABCD
1smallestFractionOnRulernextSmallestFractionOnRuler
21/161/8
3Number01/1601/8
41.5915/8
51.2511/4
61.8717/8
73.1131/8
84.3743/8
90.3303/8
1015.17151/8
113.331/4
121.511/2
133.3233/8
143.3333/8
151.12511/8
163.3533/8
173.3633/8
181.37313/8
191.1111/8
203.3933/8
211/160
220.1101/8
233.4233/8
Sheet5a


The formula in cell B4 is to get readings in 1/8 ths and higher

=IF(MOD(TEXT(ROUND($A4/$B$3,0)*$B$3,"0 ?/?"),$B$3)<>0,TEXT(ROUND($A4/$C$3,0)*$C$3,"0 ?/?"),TEXT(ROUND($A4/$C$3,0)*$C$3,"0 ?/?"))

This may not be the ultimate solution -- but in my limited testing it is working for the few cases presented here.

I hope this helps -- otherwise explain a little further and then let us take it from there.
 
Upvote 0
and the following formula in cell B4 will give us in 1/16 ths and higher ...

=IF(MOD(TEXT(ROUND($A4/$B$3,0)*$B$3,"0 ?/??"),$B$3)<>0,TEXT(ROUND($A4/$C$3,0)*$C$3,"0 ?/??"),TEXT(ROUND($A4/$B$3,0)*$B$3,"0 ?/??"))

as depicted in ...
y030923h1.xls
ABCD
1smallestFractionOnRulernextSmallestFractionOnRuler
21/161/8
3Number01/1601/8
41.5919/16
51.2511/4
61.8717/8
73.1131/8
84.3743/8
90.3305/16
1015.17153/16
113.335/16
121.511/2
133.3235/16
143.3335/16
151.12511/8
163.3533/8
173.3633/8
181.37313/8
191.1111/8
203.3933/8
211/1601/16
220.1101/8
233.4237/16
Sheet5a
 
Upvote 0
supposing your value in decimal is in the cell C7 :

=SI(MOD((C7-ENT(C7))*16;8)=0;TEXTE(C7;"#"" ""?/2");SI(MOD((C7-ENT(C7))*16;4)=0;TEXTE(C7;"#"" ""?/4");SI(MOD((C7-ENT(C7))*16;2)=0;TEXTE(C7;"#"" ""?/8");TEXTE(C7;"#"" ""??/16"))))


It's another way (well my formula is in french...)

in english it would be something like :

=IF(MOD((C7-ENT(C7))*16,8)=0,TEXT(C7,"#"" ""?/2"),IF(MOD((C7-ENT(C7))*16,4)=0,TEXT(C7,"#"" ""?/4"),IF(MOD((C7-ENT(C7))*16,2)=0,TEXT(C7,"#"" ""?/8"),TEXT(C7,"#"" ""??/16"))))

Don't know if the Function ENT in french is the same in english, maybe it semething like INT, ENT for ENTIER, it gives the Integer of a number rounded down.
 
Upvote 0
Alternatively :-

Format the cell as #??/?? and enter the following :-

=MROUND(A1,1/16)
 
Upvote 0
Thank you for the confirmation Yogi,

Finally, using your formula, with INT, it is shorter and gives :

=SI(MOD(TEXTE(ENT(16*A4)/16;"0"" ""?/??");1/16)<>0;TEXTE(ENT(8*A4)/8;"0"" ""?/??");TEXTE(ENT(16*A4)/16;"0"" ""?/??"))

=IF(MOD(TEXT(INT(16*A4)/16,"0"" ""?/??"),1/16)<>0,TEXT(INT(8*A4)/8,"0"" ""?/??"),TEXT(INT(16*A4)/16,"0"" ""?/??"))

Oh...

Format the cell as #??/?? and enter the following :-
=MROUND(A1,1/16)

woah that seems to be THE solution! :) what is the MROUND function in french? I wanna see that! :)
 
Upvote 0

Forum statistics

Threads
1,215,528
Messages
6,125,342
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top