+ Reply to Thread
Results 1 to 6 of 6

Formula to round retails to specific ending numbers

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Formula to round retails to specific ending numbers

    Hi all,
    I'm working with retail price points and I'd like to round them to certain numbers. The hundreths digit of my retails have to round up and end in either a 3,5,7, or 9. Some examples would be $1.51 rounds to $1.53, $1.28 rounds to $1.29, etc. This would be easier if I could include my prices ending in a 1 but I am only allowed to round to 3,5,7, or 9. Thank you so much for taking the time to help.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Formula to round retails to specific ending numbers

    Hi

    This does assume that you will always have 2 dec places.

    =LEFT(A1,3)+VLOOKUP(RIGHT(A1,1),{"0",0.03;"4",0.05;"6",0.07;"8",0.09},2)

    HTH

    rylo

  3. #3
    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: Formula to round retails to specific ending numbers

    Or

    =FLOOR(A1, 0.1) + LOOKUP(MOD(100*A1, 10), {0,4,6,8}, {3,5,7,9}%)
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula to round retails to specific ending numbers

    Thank you for the fast replies!

    Rylo your formula works great from .00 to .09 but anything ending with .10 and greater causes the formula to create a vaule of .03,.05,.07,.09. Ex: $1.11 is creating a value of $1.03.

    shg your formula is almost there. =FLOOR(A1, 0.1) + LOOKUP(MOD(100*A1, 10), {0,4,6,8}, {3,5,7,9}%)
    I changed your formula to match what I wanted to do by making it into
    =FLOOR(A1, 0.1) + LOOKUP(MOD(100*A1, 10), {3,5,7,9}, {3,5,7,9}%), however for some reason numbers like .10, .20, .30, etc are displaying an error.

    Thank you both for your help so far.

  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

    Re: Formula to round retails to specific ending numbers

    Rounding error:

    =FLOOR(A3, 0.1) + LOOKUP(MOD(100*A3, 10), {-1,4,6,8}, {3,5,7,9}%)

  6. #6
    Registered User
    Join Date
    07-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula to round retails to specific ending numbers

    Thanks shg! That fixed it!

+ 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