+ Reply to Thread
Results 1 to 10 of 10

Separating the Parts of a Mixed Number?

  1. #1
    Registered User
    Join Date
    11-04-2007
    Posts
    4

    Separating the Parts of a Mixed Number?

    Hello,

    Is it possible to separate the parts of a mixed number? I have a cell in which is generated a decimal number. I can convert this to a mixed number. What I need to do from there is extract the whole number and the numerator. Is there a way to do this?

    Thank you,
    Tom
    Last edited by tomn; 11-04-2007 at 11:02 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you mean the whole number and the decimal, then

    =MOD(A1,1) is the decimal
    =INT(A1) is the whole number.

  3. #3
    Registered User
    Join Date
    11-04-2007
    Posts
    4
    Super, that solves one of the two problems. I can now separate the whole number from the decimal!!!!! thank you.

    Now I have a decimal that I can turn into a fraction. How do I separate the numerator from the denominator????

    Thanks,
    Tom

  4. #4
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373
    Hi Tom

    I'm not sure I understand exactly what you want.

    1 - If it's to display the number as a mixed number, you can do it directly using a custom format, like

    # #/#
    # #/##
    # #/###

    where you define the precision by setting the maximum number of digits in the denominator.

    For ex., for the sqare root of 2 you get 1 2/5, 1 29/70, 1 408/985.


    2 - If you want to extract just the denominator to another cell you can use the TEXT() function and extract the number after the "/"

    For ex., for a denominator with a maximum of 3 digits:

    =IF(ISERROR(FIND("/",TEXT(A1,"# #/###"))),"",--MID(TEXT(A1,"#/###"),1+FIND("/",TEXT(A1,"#/###")),3))

    HTH
    lecxe

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    There is a method call continued fractions to obtain successively better rational approximations to any given number.

    For pi, for example, 3, 22/7, 333/106, 355/113, 103993/33102, ...

    For e, 3, 8/3, 11/4, 19/7, 87/32, 106/39, 193/71, ...

    Why do want to do this?

  6. #6
    Registered User
    Join Date
    11-04-2007
    Posts
    4
    Thanks,

    Getting closer. Here is what I need now. I have a cell in which is generated a decimal number such as 7.719. I can format that to be a mixed number with a denominator of 256. I will always have that denominator, or 512. So now the cell shows 7 184/256. How can I extract the 184 into another cell?

    Thanks,
    Tom

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =round(mod(A1, 1) * 256, 0) Note that 184/256 simplifies to 23/32

    0.719: 1, 2/3, 3/4, 5/7, 18/25, 23/32, 87/121, 632/879, 719/1000 (exact).
    Last edited by shg; 11-05-2007 at 11:23 AM.

  8. #8
    Registered User
    Join Date
    11-04-2007
    Posts
    4

    Wow Shg!!!

    WOW SHG! That is it! My hat is off to you.

    Thanks,
    Tom

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    A mere bagatelle ...

    You're welcome

    edit: BTW, you can use the GCD function to minimize fractions.
    Last edited by shg; 11-05-2007 at 01:22 PM.

  10. #10
    Registered User
    Join Date
    02-26-2019
    Location
    US
    MS-Off Ver
    2016
    Posts
    1

    Re: Separating the Parts of a Mixed Number?

    Combining the helps above .... from over a decade ago ;-P ... C2 is my decimal calculated from elsewhere .... C2=2.4375, D2=(C2-F2)*E2, E2=GCD(ROUND(MOD(C2, 1)*512, 0),512), F2=TRUNC(C2,0), G2=D2/GCD($D2,$E2), H2=E2/GCD($D2,$E2) == 2_7/16 !!! .... thanks tomn for inquiring, and shg for guru'ing !!! ..... not perfect, but best for me for now
    Last edited by jinngonqui; 02-26-2019 at 12:32 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1