+ Reply to Thread
Results 1 to 4 of 4

Lookup if a number is within a range and return cell value, with multiple results

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    Flemington, NJ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Lookup if a number is within a range and return cell value, with multiple results

    Hello,
    I have been working on a formula for a couple weeks and cannot figure it out!

    I need to determine if a number is within a range, then give a value based on the result. However, the ranges are not mutually exclusive, so there could be multiple results.

    For example:

    Col A...............Col B................Col C
    Low Degree......High Degree.......Color
    88..................115..................Red
    32..................95....................Blue
    36..................97....................Orange
    36..................86....................Yellow

    So if my look-up value is 52, the results would be Blue, Orange and Yellow.

    The formula I've used looks like this:

    =IFERROR(INDEX($A$36:$C$60,SMALL(IF(AND($A$36:$A$60<=$D$9,$B$36:$B$60>=$D$9),ROW($A$36:$A$60)-35),ROW(A1)),3),"") - Entered using Control+Shift+Enter

    However, this only returns the first item in the list (ie "Red"), no matter what the look-up value is. (In the above formula, $D$9 = 52 in my example.)

    Any ideas? I'm desperate!

    Thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup if a number is within a range and return cell value, with multiple results

    Try it like this...

    Assume you're entering the array formula** in cell E36:

    =IFERROR(INDEX(C:C,SMALL(IF($D$9>=$A$36:$A$60,IF($D$9<=$B$36:$B$60,ROW($C$36:$C$60))),ROWS(E$36:E36))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-07-2013
    Location
    Flemington, NJ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Lookup if a number is within a range and return cell value, with multiple results

    It works!!!! Thank you SOOOOO much! You are my hero!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup if a number is within a range and return cell value, with multiple results

    You're welcome. Thanks for the feedback!

+ 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