+ Reply to Thread
Results 1 to 8 of 8

Round Price Up or Down to nearest $.99 based on a Condition

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Bay Area, Ca
    MS-Off Ver
    Excel 2010
    Posts
    10

    Round Price Up or Down to nearest $.99 based on a Condition

    Hello folks,

    I don't know if there's any direct way to do this in Excel using some kind of nested formula in a single column or if there are other strategies you might suggest.

    Basically, I have a price list. I need to test each price in the column and round down to the nearest $.99 if the price is greater than $15.00, and round up if the price is equal to or less than $15.00. I want to do this in the fewest steps possible using Excel functions.

    Any suggestions are greatly appreciated.

    Thanks in Advance,
    ~46
    Last edited by agent46; 04-23-2013 at 04:14 PM.

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    Assuming that price is in Cell A1, try this
    Please Login or Register  to view this content.
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    This may work for you:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  4. #4
    Registered User
    Join Date
    12-13-2012
    Location
    Bay Area, Ca
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    Thanks Guys,

    Both your approaches appear to work. I didn't know how to nest Excel functions. You both gave good examples. Unfortunately, I didn't know I could only add to one of your reputations. I owe you one LEM. Yours is the simpler solution in fact.

    All the Best!

    ~46

  5. #5
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    The solution Melvin provided is universally better, because it can avoid case like price 17.99 being rounded down to 16.99, that's why it's a bit longer, but the later part is the same.

    However, I cannot seem to get his formula to work, and have to tweak it into
    Please Login or Register  to view this content.
    They both are the same if you ask me, but for some reason on my Excel, when I test 16.99 his formula returns 15.99 instead, and I have to tweak it like the formula above to make it work

  6. #6
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    I've been testing the formula and running into some issues myself. Perhaps try this one:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I believe the green part is needed to avoid having 16.99 being rounded down to 15.99.
    Trial and error will be your best bet.

  7. #7
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    You MAY run into issues because the ROUND and INT function are not exact. If I have 16.99 in B2, =B2-INT(B2) is actually returning 0.98999999999999800000
    You may want to use =IF(ROUND(B2-INT(B2),2)=.99,xxxxxxxxxxxxxx)

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Round Price Up or Down to nearest $.99 based on a Condition

    Quote Originally Posted by agent46 View Post
    .....round down to the nearest $.99 if the price is greater than $15.00, and round up if the price is equal to or less than $15.00. I want to do this in the fewest steps possible using Excel functions..
    If you take this literally it would lead to what I would regard as inconsistent results, wouldn't $15.98 round down, giving you $14.99......but $15.00 will round up to $15.99? I would suggest that you make the cutoff point $14.99, try this formula

    =ROUND(B2+0.01+IF(B2<14.99,1,-1)/2,0)-0.01
    Audere est facere

+ 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