+ Reply to Thread
Results 1 to 7 of 7

Trying to create a formula that can round number up to a certain value depnding on the #

  1. #1
    Registered User
    Join Date
    07-18-2016
    Location
    Oregon
    MS-Off Ver
    Professional Plus 2010
    Posts
    5

    Lightbulb Trying to create a formula that can round number up to a certain value depnding on the #

    Hi All!

    I haven't been having luck-- I am trying to get a formula that sees to the following:

    If the price in A2 is <$3, then the cell in B2 should round the decimal points (cents) up or down (the nearest number) of these 3: .39, .69, .99
    If the price in A2 is >$3 but <$10, then the cell in B2 should round the decimal points (cents) up or down (the nearest number)of these 2: .69, .99
    If the price in A2 is >$10, then the cell in B2 should round the decimal points (cents) up or down (the nearest number) to .99

    Help!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Trying to create a formula that can round number up to a certain value depnding on the

    It's a bit of a monster, but try this in B2:

    =IF(A2<=3,IF(AND(MOD(A2,1)>0.2,MOD(A2,1)<=0.55),ROUNDUP(A2,0)-0.61,IF(AND(MOD(A2,1)>0.55,MOD(A2,1)<=0.85),ROUNDUP(A2,0)-0.31,ROUND(A2,0)-0.01)),IF(A2<10,IF(AND(MOD(A2,1)>0.35,MOD(A2,1)<0.85),ROUNDUP(A2,0)-0.31,ROUND(A2,0)-0.01),ROUND(A2,0)-0.01))

    then copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Trying to create a formula that can round number up to a certain value depnding on the

    Hi lantros,

    After defining 3 different named ranges for a VLookup, see if this formula works for you.

    =INT(A2)+VLOOKUP(MOD(A2,1),(IF(A2<=3,LT,IF(A2>=10,GT,BET))),2,TRUE)

    The LT is <3, the GT is >10 and the Bet is the other. See the attached. Type any number in column A and see what the formula in Col B gives.
    Vlookup to best tax cents.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-18-2016
    Location
    Oregon
    MS-Off Ver
    Professional Plus 2010
    Posts
    5

    Unhappy Re: Trying to create a formula that can round number up to a certain value depnding on the

    Thanks everyone! Pet_UK's solution was the closest, but still no cigar. This is what happened(the formula was in the second column):

    2.25 1.99
    2.12 1.99
    2.06 2.99
    2.88 2.39
    2.48 -0.01
    12.55 1.99
    20.32 1.99
    9.06 2.99
    9.52 2.39


    This is what i was hoping to happen:

    2.25 2.39
    2.12 1.99
    2.06 1.99
    2.88 2.99
    2.48 2.39
    12.55 12.99
    20.32 19.99
    9.06 8.99
    9.52 9.69

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Trying to create a formula that can round number up to a certain value depnding on the

    OK lantros,

    Try this one. It seems to work for your ranges.

    Vlookup to best tax cents 2.xlsx

    You will need to see the Named Ranges for LT, GT and Bet as they are the lookup tables that make the VLookup range work.

  6. #6
    Registered User
    Join Date
    07-18-2016
    Location
    Oregon
    MS-Off Ver
    Professional Plus 2010
    Posts
    5

    Re: Trying to create a formula that can round number up to a certain value depnding on the

    Thank you! This works perfectly!

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Trying to create a formula that can round number up to a certain value depnding on the

    I put your numbers in column A starting at A2 and put my formula in B2 and copied it down - it produces exactly the same values that you were hoping for (file attached), so you mustn't have copied the formula properly.

    Hope this helps.

    Pete
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Round Down formula - Not using a whole number
    By Kraftyk in forum Excel General
    Replies: 2
    Last Post: 06-08-2015, 10:41 PM
  2. Replies: 2
    Last Post: 12-06-2014, 01:58 PM
  3. [SOLVED] How to create a formula/format for a long number to include a period and not round
    By Rita Bush in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-13-2013, 01:13 PM
  4. Replies: 6
    Last Post: 10-19-2012, 04:55 PM
  5. [SOLVED] Formula that adds text from one page into a cell depnding on the value of another
    By VivatMartin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-31-2012, 05:14 AM
  6. Replies: 9
    Last Post: 02-08-2012, 07:32 PM
  7. [SOLVED] i would like to know a formula on how to round a number to 500
    By beti10 in forum Excel General
    Replies: 2
    Last Post: 02-07-2006, 10:20 AM

Tags for this Thread

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