Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Please explain this fraction formula.

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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 ]

  2. #2
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •