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
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