Please explain this fraction formula.

nicknicknickandnick

New Member
Joined
Apr 29, 2002
Messages
29
I found an interesting formula here:
http://www.mrexcel.com/tip039.shtml

The purpose of the formula is to take a value (here it is in B2) and express it to the nearest fraction in 16ths, and if that fraction can be expressed in lower terms (8ths, 4ths, or halves), then it is.
My question follows this formula.

The formula is:
IF(MOD(INT(16*(+B2-INT(B2)+0.0312)),16)=0,TEXT(B2,"#"),IF(MOD(INT(16*(+B2-INT(B2)+0.0312)),8)=0,TEXT(B2,"# 0/2"),IF(MOD(INT(16*(+B2-INT(B2)+0.0312)),4)=0,TEXT(B2,"# 0/4"),IF(MOD(INT(16*(+B2-INT(B2)+0.0312)),2)=0,TEXT(B2,"# 0/8"),TEXT(B2,"# 0/16")))))

I believe I understand most of the formula. I know what the functions IF,MOD,INT, and TEXT do. What I don't understand is the use of the value 0.0312 throughout the formula. What is the importance of using this specific value? I am mathematically curious. (I emailed this site to ask, but was given a form letter response to try this message board.)

I wonder, is it related to the fact that 1/16 divided by two is 0.03125?

Thanks in advance.
This message was edited by nicknicknickandnick on 2002-04-30 13:11
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I have not looked at the formula itself, however, .0312 being used in the formula represents the fraction 1/32.

1/32=.03125

Hope This Helps!
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,916
Members
448,533
Latest member
thietbibeboiwasaco

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