+ Reply to Thread
Results 1 to 7 of 7

Rounding table and Vlookup?

  1. #1
    Registered User
    Join Date
    09-10-2017
    Location
    Auckland,New Zealand
    MS-Off Ver
    2016
    Posts
    59

    Rounding table and Vlookup?

    Hey,

    I have an if formulae that rounds a value depending on the range it falls between. Its very long and messy and i would like to have the capability of changing the table so i think a vlookup would be best suited. is it possible to run a vlookup without an exact match i.e. values in a given range?

    If 15 < qty < 100, round up to nearest 5.
    If 100 < qty < 300, round up to nearest 10
    If 300 < qty < 500, round up to nearest 50
    If qty > 500, round up to nearest 100.

    Thanks,

    Adam

  2. #2
    Registered User
    Join Date
    09-10-2017
    Location
    Auckland,New Zealand
    MS-Off Ver
    2016
    Posts
    59

    Re: Rounding table and Vlookup?

    Also unfortunately, i know how to upload excel files but it is not working at the moment for me. so i cant show an example unfortunately =(

  3. #3
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Rounding table and Vlookup?

    Try

    =MROUND(A1,LOOKUP(A1,{0,15,100,300,500},{1,5,10,50,100}))

    or

    =MROUND(A1,LOOKUP(A1,$I$1:$I$5,$J$1:$J$5))

    where I1:I5 contains 0,15,100,300,500, and J1:J5 contains 1,5,10,50,100
    Last edited by Root_; 02-27-2018 at 03:45 PM.

  4. #4
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Rounding table and Vlookup?

    Hi, adamire!

    If you have the number in A1, try this formula:
    =MROUND(A1,LOOKUP(A1,{15;100;300;500},{5;10;50;100}))

    Blessings!

  5. #5
    Registered User
    Join Date
    09-10-2017
    Location
    Auckland,New Zealand
    MS-Off Ver
    2016
    Posts
    59

    Re: Rounding table and Vlookup?

    Thanks so much for the reply.

    That is nearly perfect, is it possible to round up though? or do you have to use the mround funtion?

  6. #6
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Rounding table and Vlookup?

    For rounding up, use

    =CEILING(A1,LOOKUP(A1,{0,15,100,300,500},{1,5,10,50,100}))
    =CEILING(A1,LOOKUP(A1,$I$1:$I$5,$J$1:$J$5))

  7. #7
    Registered User
    Join Date
    09-10-2017
    Location
    Auckland,New Zealand
    MS-Off Ver
    2016
    Posts
    59

    Re: Rounding table and Vlookup?

    That is so awesome thanks.

+ 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. % rounding to 11.000 instead of (ie) 11.432 in pivot table
    By kafarrell in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-16-2018, 03:02 PM
  2. [SOLVED] VLookup and Rounding If No Match
    By BrownTeddyBear in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 06-09-2017, 09:02 AM
  3. [SOLVED] Calculation error when using VLOOKUP due to rounding
    By Baconfish in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2017, 02:46 PM
  4. How to stop excel table from rounding?
    By Coinpie in forum Excel General
    Replies: 5
    Last Post: 10-17-2015, 05:56 PM
  5. Vlookup PREDETERMINED range and ROUNDING Help Plz
    By siegreen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2010, 07:29 AM
  6. Vlookup Rounding
    By wmaughan in forum Excel General
    Replies: 9
    Last Post: 12-27-2005, 08:00 PM
  7. Rounding criteria within a nested vlookup and hlookup
    By Jay Z in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2005, 07:06 PM

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