+ Reply to Thread
Results 1 to 7 of 7

Finding a value within a set of ranges

  1. #1
    Registered User
    Join Date
    10-15-2008
    Location
    Atlanta
    Posts
    3

    Question Finding a value within a set of ranges

    I have a set min/max levels that have a definition. For example.
    1-99 = SMALL
    100-499 = MEDIUM
    500-999 = LARGE
    1000+ = XLARGE

    In a seperate column I have values that I want to find the descriptor for: For example: If I have the value = 234, Then the output of the formula should be "MEDIUM".

    More Detail if needed:

    Column A Values:
    1
    100
    500
    1000
    Column B Values
    99
    499
    999

    Column C values
    SMALL
    MEDIUM
    LARGE
    XLarge

    On A seperate sheet I have the values in column A:

    236
    43
    499
    14923
    345

    Same sheet in Column B I want a formula that would find the descriptor for each of the values in Column A.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Finding a value within a set of ranges

    With
    On Sheet1
    A1:C4 contains this list...
    Please Login or Register  to view this content.
    Then, this formula on Sheet2 finds the category
    for the value in A1
    Please Login or Register  to view this content.
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    05-21-2004
    Location
    UK
    Posts
    136
    =INDEX(Sheet1!$C$1:$C$4,MATCH(A1,Sheet1!$A$1:$A$4))

  4. #4
    Registered User
    Join Date
    10-15-2008
    Location
    Atlanta
    Posts
    3

    Finding a value within a set of ranges

    I believe the Index/Match may work. Will it work if the values are not sequential. The reason why I ask is that the formula doesn't ever look at Column B of the range.

    For example if the data was:

    5-456
    500-593
    985-3495

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Finding a value within a set of ranges

    Are you saying that the values 0 thru 4, 457 thru 499, and 594 thru 984 will never occur?
    Or do you want them handled differently?


    5-456
    500-593
    985-3495

  6. #6
    Registered User
    Join Date
    10-15-2008
    Location
    Atlanta
    Posts
    3
    They could occur. I was just going to treak it as "Other" or something to affect. My real data is to complex or long to go in and classify those in between values as "Other". I am ok with a #n/a value or something to affect. I can adjust accordinally.

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Finding a value within a set of ranges

    I attached a workbook to help demonstrate the approach I took.

    Here's the description:

    Sheet1 has this lookup list in A1:C7
    Please Login or Register  to view this content.
    On Sheet2, this formula assigns a category to the value in A1...
    Please Login or Register  to view this content.
    Does that help?
    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. Copy/Paste Range(s) without activating/selecting Range(s)
    By hmissoumi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-03-2008, 01:29 PM
  2. Replies: 1
    Last Post: 04-10-2008, 11:47 AM
  3. problem with function ranges
    By Jon Knights in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2008, 09:37 AM
  4. Combining Named Ranges
    By dmartindale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2007, 05:50 PM
  5. Finding Values for Multiple Ranges in one Sheet
    By adnan.rehman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-03-2007, 12:37 AM

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