+ Reply to Thread
Results 1 to 9 of 9

Excel Rounding Problems

  1. #1
    Registered User
    Join Date
    01-16-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    13

    Excel Rounding Problems

    Hi

    I am trying to produce a set of figures in column B for a a set in column A.
    The figure produce in Column B should be determine on preset conditons
    If A<80%, B=0
    If A>100%, B=20
    If 80<=A<=100%, B= A-80%

    All of set in A are positive percentages
    The figure should then be *100 and then rounded down to the closest integer.

    I have been using
    "=INT((IF(A1>1, 0.2, (IF(80%<=A1, A1-0.8, 0)))*100))"

    A B
    0.75 0
    0.76 0
    0.77 0
    0.78 0
    0.79 0
    0.8 0
    0.81 1
    0.82 1
    0.83 2
    0.84 3
    0.85 4
    0.86 5
    0.87 6
    0.88 8
    0.89 9
    0.9 10

    As you can see there appears to be rounding issues possibly made during the calculations that is affection 0.82-0.87.
    Would anybody be able to advise on this or produce an alternative formula for the same thing?

    Thanks
    Last edited by joejensen; 02-04-2009 at 09:32 PM. Reason: [SOLVED]

  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(a1 < 80%, 0, if(a1 < 100%, a1 - 80%, 20% ))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-16-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    13
    Quote Originally Posted by shg View Post
    =if(a1 < 80%, 0, if(a1 < 100%, a1 - 80%, 20% ))
    Thanks for the help,

    However, the central formula within the original works as does yours.
    The issues i'm having is when the formula rounds it to down to the lowest integer. This has to be done as in practice cell A will contain percentages to 2 decimal places. i.e 93.45% or 0.9345.
    At a later date I am gong to need to assign a value to each full percentage point which is reasoning behind rounding.

    Can you offer assistance with this?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It seems to me that your formula already does what you describe.

    Provide some examples of where it doesn't, and what you want instead.

  5. #5
    Registered User
    Join Date
    01-16-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    13
    Quote Originally Posted by shg View Post
    It seems to me that your formula already does what you describe.

    Provide some examples of where it doesn't, and what you want instead.
    The formula doesn't appear to work when the section A =82.00%, 83.00%, 84.00%, 85.00%, 86.00% and 87.00%.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    What should it return in those cases?

  7. #7
    Registered User
    Join Date
    01-16-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    13
    Quote Originally Posted by shg View Post
    What should it return in those cases?
    A=82.00% B should = 2
    A=83.00% B should = 3
    A=84.00% B should = 4
    A=85.00% B should = 5
    A=86.00% B should = 6
    and A=87.00% B should = 7

    The original formula should return A-80%*100 ( minus the prior conditions, a<80% and a>100%

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Looks fine to me:
    Please Login or Register  to view this content.
    You could also use =MIN(20%, (A1>80%)*(A1-80%))
    Last edited by shg; 01-19-2009 at 02:59 PM.

  9. #9
    Registered User
    Join Date
    01-16-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    13
    Quote Originally Posted by shg View Post
    Looks fine to me:
    Please Login or Register  to view this content.
    You could also use =MIN(20%, (A1>80%)*(A1-80%))

    Thanks for your help,
    I have no idea why the original formula was returning incorrect figures in my spreadsheet. I have amended it slightly and all seems to be well now

    =INT((IF((A1*100)>100, 20, (IF(80<=(A1*100), (A1*100)-80, 0)))))

    thanks for you help

+ 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