+ Reply to Thread
Results 1 to 15 of 15

ROUNDUP and ROUNDDOWN function

  1. #1
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    ROUNDUP and ROUNDDOWN function

    I am using the following function to try to calculate some sales competition points and it is working in reverse.

    =IF((N4-0.05)>=0, 10+ ROUNDDOWN((N4-0.05)*100,0)*1,10 + ROUNDUP((N4-0.05)*100,0)*1)

    **(N4=Salesman RAL Rate)**

    The narrative version of my calculation is the following.

    "*Salesmen earn 10 points for maintaining a RAL rate equal to 5% and gain/lose 1 point for every full percentage over/unde 5%." Example: A RAL rate of 4% would earn 11 points.

    However, it is working in reverse order and subtracting 1 point for each percentage under and adding for each percentage under. Any advice would be appreciated.

    Thanks! Jim

  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

    Re: Problem using ROUNUP and ROUNDDOWN function

    That seems a little ambiguous. How many points for 4.5%?

    Not 10, because they didn't achieve 5%.

    Not 11, because it's less than a full point off 5%.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Problem using ROUNUP and ROUNDDOWN function

    They should stay at 10 points until they reach a full percentage point below/above. So if they are at 4.5% they would remain at 10 points until they reach 4% and then they would get 11 points. I hope that helps. Thanks!

  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

    Re: Problem using ROUNUP and ROUNDDOWN function

    Maybe ...

    =10 + FLOOR(5 - 100*N4, SIGN(5 - 100*N4))

  5. #5
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Problem using ROUNUP and ROUNDDOWN function

    The logical test is returning as FALSE.

  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

    Re: ROUNDUP and ROUNDDOWN function

    There is no logical test in that formula:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: ROUNDUP and ROUNDDOWN function

    The following works to calculate another portion of my sales competition. However, it does not correctly calculate the points if they are less than the benchmark of 98%. For instance, if they are 97.4% it subtracts six points when it should wait until 97% is reached and then subtract six.

    =IF((AN4-0.98)>=0, 10+ ROUNDDOWN((AN4-0.98)*100,0)*6,10 + ROUNDUP((AN4-0.98)*100,0)*6)

    Like I said, it works in the other direction. If they reach 100% it yields a total of 22 points. Ten for reaching 98% and an additional 12 for each percentage over.

    The logical test for the orginal question is the same except it is looking to see if it is 5% instead of 98%. What is the difference.

  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

    Re: ROUNDUP and ROUNDDOWN function

    We started here:
    Salesmen earn 10 points for maintaining a RAL rate equal to 5% and gain/lose 1 point for every full percentage over/unde 5%." Example: A RAL rate of 4% would earn 11 points.
    I'm happy to move on to another question if you tell me the first one is solved, James.

  9. #9
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: ROUNDUP and ROUNDDOWN function

    I'm sorry, I was trying to explain the logic test from the other spreadsheet was not returning false like this one.

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

    Re: ROUNDUP and ROUNDDOWN function

    So -- is the first problem sorted with the formula I provided?

    If not, post a workbook that shows the formula not working.

    If so, explain the second problem.

  11. #11
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: ROUNDUP and ROUNDDOWN function

    FY11
    POINTS
    4.26% 9
    0.00% 5
    0.00% 5
    4.00% 9
    6.06% 11
    4.17% 9
    4.88% 9
    3.70% 8

    =IF((N4-0.05)>=0, 10+ ROUNDDOWN((N4-0.05)*100,0)*1,10 + ROUNDUP((N4-0.05)*100,0)*1)

    This is the formula and it is calculating backwards.

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

    Re: ROUNDUP and ROUNDDOWN function

    Did you try my formula?

  13. #13
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: ROUNDUP and ROUNDDOWN function

    Quote Originally Posted by shg View Post
    Did you try my formula?
    I have the following and it returns false.
    =IF((N4-0.05)>=0,10+FLOOR(5-100*N4,SIGN(5-100*N4)))

  14. #14
    Registered User
    Join Date
    11-23-2010
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: ROUNDUP and ROUNDDOWN function

    I used the following and it fixed it.

    =IF((N4-0.05)<>0, 10- ROUNDDOWN((N4-0.05)*100,0)*1,10 + ROUNDUP((N4-0.05)*100,0)*1)

    Thanks for your help. Jim

  15. #15
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: ROUNDUP and ROUNDDOWN function

    ........................
    Quote Originally Posted by shg
    There is no logical test in that formula

+ 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