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

Thread: Formula for a fraction

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Christy
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello All,
    I need a formula in cell U24 that will look at the result in cell J16 and, if it sees a fraction, it will divide only the fraction part of the number into 42.
    Here's an example:

    cell J16 contains 12.6
    cell U24 will divide 42 by .6, round that result up to nearest whole number
    and display 26
    If cell J16 contains a whole number with no decimal, cell U24 will display 0.
    Thank you so much for any help you can provide!
    ~Christy

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-09 13:26, Christy wrote:
    Hello All,
    I need a formula in cell U24 that will look at the result in cell J16 and, if it sees a fraction, it will divide only the fraction part of the number into 42.
    Here's an example:

    cell J16 contains 12.6
    cell U24 will divide 42 by .6, round that result up to nearest whole number
    and display 26
    If cell J16 contains a whole number with no decimal, cell U24 will display 0.
    Thank you so much for any help you can provide!
    ~Christy
    42 divided by 0.6 is 70. I don't understand how you arrived at 26. Can you clarify?
    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The following seems to give the result you want, but I'd test it with other values also: -

    =IF(INT(J16)<>J16,ROUNDUP(42*(J16-INT(J16)),0))

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    83,637
    Post Thanks / Like
    Mentioned
    33 Post(s)
    Tagged
    6 Thread(s)

    Default

    On 2002-03-09 13:26, Christy wrote:
    Hello All,
    I need a formula in cell U24 that will look at the result in cell J16 and, if it sees a fraction, it will divide only the fraction part of the number into 42.
    Here's an example:

    cell J16 contains 12.6
    cell U24 will divide 42 by .6, round that result up to nearest whole number
    and display 26
    If cell J16 contains a whole number with no decimal, cell U24 will display 0.
    Thank you so much for any help you can provide!
    ~Christy
    Christy,

    =IF(J16-INT(A16),ROUND(42/(J16-INT(J16)),0),0)

    I get 70, not 26 when J16 is 12.6. Is that wrong.

    Aladin

  5. #5
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Aladin, I think Mudface is on the right track. It appears she meant to say 42 * 0.6, not 42/0.6.

    Take care
    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  6. #6
    New Member
    Join Date
    Feb 2002
    Location
    Christy
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thank you so much! I'm sorry for the mistake, it *is* supposed to be 42 *.06 and Mudface's answer works perfectly - Thank you all soooooo much!
    ~Christy

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
  •