+ Reply to Thread
Results 1 to 7 of 7

Range Lookup

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    Spain ,Spain
    MS-Off Ver
    Excel 2003
    Posts
    2

    Range Lookup

    Hi All,

    I'm trying to create a range lookup formula in excel and am having some problems. Let me describe the scenario.

    Say I have the following grid

    Level min max
    1 0 10
    2 10 32
    3 32 50

    .. (etc)

    given an number (example 23) how would I write a formula that finds the "Level" for this number. exmaple: 23 should return 2 as 23 falls between the 10-32 range defined in the chart.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Range Lookup

    what about 10? or 32? what range would they fall in?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-02-2010
    Location
    Spain ,Spain
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Range Lookup

    Very good point. Is it possible to just return the first matched range? I could also change the data so the next range starts at +1 of the last ranges end.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Range Lookup

    one way , but depends on your boundaries and really how large the look up would be is
    =LOOKUP(A1,{0,11,33},{1,2,3})

  5. #5
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Range Lookup

    Hi Martin - if you have the time/inclination, would you mind translating this formula for me please LOOKUP(A1,{0,11,33},{1,2,3}) in particular, the curly brackets. Thanks v much
    Darren
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Range Lookup

    if it was say
    B1=0
    B2=11
    B3=33
    AND
    D1=1
    D2=2
    D3=3
    you'd use
    LOOKUP(A1,b1:b3,d1:d3)
    but since you aren't using a cell range you can create your own using { }
    lookup returns from excel help

    If LOOKUP can't find the lookup_value, it matches the largest value in lookup_vector that is less than or equal to lookup_value.

  7. #7
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Range Lookup

    Thanks Martin - for your time. Really helpful.

    So if i was to go away and study this function should o be googling "lookup Vector" or "Lookup Array" or just plain Lookup?

    Thanks mate

+ 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