+ Reply to Thread
Results 1 to 5 of 5

How to determine which range a value falls within and output a value from the same row

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to determine which range a value falls within and output a value from the same row

    I have a set of 3 columns, each row with a min and max value in separate columns, and a corresponding date for that number range. If I have another column with a specific number, is there a way to find the date that this collection was made? In other words I need to find the row were my number falls between the min and max values and output the corresponding date. The values and min/max ranges will not necessarily be sorted in order so the MATCH function will not work. An example of my data is attached. I need to do this for hundreds of values.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-13-2010
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2003; 2007
    Posts
    441

    Re: How to determine which range a value falls within and output a value from the same row

    Try this : F2 --> =SUMPRODUCT(($A$2:$A$5<=E2)*($B$2:$B$5>=E2)*($C$2:$C$5))
    ...If my answer helped you, Please, click on. * Add Reputation (at left)

    Best regards.
    Marc?lio Lob?o

  3. #3
    Registered User
    Join Date
    10-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to determine which range a value falls within and output a value from the same row

    That works perfectly! Thank you so much. Could I still use this equation if the value I wanted to find was a string of text instead of a date?

  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: How to determine which range a value falls within and output a value from the same row

    No, that formula will not return text values.

    The values and min/max ranges will not necessarily be sorted in order
    Try this...


    Data Range
    A
    B
    C
    D
    E
    F
    1
    min
    max
    Regon
    -----
    collection #
    Region
    2
    33
    56
    North
    75
    East
    3
    73
    92
    East
    35
    North
    4
    108
    121
    South
    109
    South
    5
    137
    168
    West
    120
    South
    6
    42
    North
    7
    138
    West
    8
    152
    West


    This array formula** entered in F2 and copied down:

    =IFERROR(INDEX(C$2:C$5,MATCH(1,IF(E2>=A$2:A$5,IF(E2<=B$2:B$5,1)),0)),"")

    ** 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.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Valued Forum Contributor
    Join Date
    05-13-2010
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2003; 2007
    Posts
    441

    Re: How to determine which range a value falls within and output a value from the same row

    Good evening.

    If you donīt know when you will have text or value as a result of SUMPRODUCT function, try this one:

    Before:
    F2 --> =SUMPRODUCT(($A$2:$A$5<=E2)*($B$2:$B$5>=E2)*($C$2:$C$5))

    Now:
    F2 --> =INDIRECT("C"&SUMPRODUCT(($A$2:$A$5<=F2)*($B$2:$B$5>=F2)*ROW($C$2:$C$5)),1)

    Please, tell us if it worked for you.


    Greetings from Brazil

+ 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. [SOLVED] Determine if value falls between multiple ranges
    By T15K in forum Excel General
    Replies: 4
    Last Post: 01-20-2021, 03:25 AM
  2. [SOLVED] Determine if a value falls within a horizontal and vertial range
    By td87280 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-31-2012, 05:13 PM
  3. Determine if give string falls between ranges
    By jsimha in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2012, 04:54 AM
  4. Replies: 3
    Last Post: 07-31-2012, 04:44 PM
  5. Formula to determine whether number falls within range??
    By Cat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2005, 10:05 PM

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