+ Reply to Thread
Results 1 to 13 of 13

Help Needed in Returning Values when looking up between 2 Numbers

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    38

    Help Needed in Returning Values when looking up between 2 Numbers

    Not sure how to explain the help I need. So I have a list of names with their ages... such as

    Mark 24
    Steve 35
    Bob 42
    Dave 45
    Jack 52
    Dean 55
    Dan 60

    My query is if I have 2 values say 30 and 45

    Then I would like the function to return the names of Steve, Bob, Dave, since they are between the ages of 30 and 45

    I need a formula that would return all of these names either in 1 cell or in seperate cells...

    Thank you

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    question:

    in the example data you gave is "Mark 24" listed in one cell? or is Mark in column A and 24 in column B?
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  3. #3
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    38

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Name is B, Age is C but this can be moved around if you need the age B and Name C

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,070

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Please attach a sample workbook.

  5. #5
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    A
    B
    C
    D
    E
    F
    G
    H
    1
    name age name age min age max
    2
    Mark
    24
    Steve
    30
    45
    3
    Steve
    35
    Bob
    4
    Bob
    42
    Dave
    5
    Dave
    45
    6
    Jack
    52
    7
    Dean
    55
    8
    Dan
    60



    E2=IFERROR(INDEX($A$2:$A$100,AGGREGATE(15,6,ROW($A$2:$A$100)-ROW($A$2)+1/($B$2:$B$100>=$G$2)/(($B$2:$B$100<=$H$2)),ROWS($A$2:A2))),"")

    Copy down

  6. #6
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    38

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Here you go
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,070

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    CARACALLA has provided a solution in post #5.

  8. #8
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    38

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    please see my sample workbook, i appreciate his solution but I was hoping for something different.

  9. #9
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Replacement


    F4=IFERROR(INDEX(Spares!$B$2:$B$100,AGGREGATE(15,6,ROW(Spares!$B$2:$B$100)-ROW(Spares!$B$2)+1/(Spares!$C$2:$C$100>=Replacement!$B$4)/(Spares!$C$2:$C$100<=Replacement!$C$4),COLUMNS(Replacement!$A$1:Replacement!A1))),"")

    Copy across

  10. #10
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    38

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    The formula above does not work, I am wondering if it's because I am working in google sheets and the formula does not work the same way

  11. #11
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,070

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    It's an array formula, try entering with Ctrl-Shift-Enter.

  12. #12
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,070

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Quote Originally Posted by joerainone View Post
    please see my sample workbook, i appreciate his solution but I was hoping for something different.
    With Excel 2010, this could be the only solution. If you have 365, you could use the formula:=FILTER(B2:B8,IF(C2:C8>=25,C2:C8<=45))

  13. #13
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: Help Needed in Returning Values when looking up between 2 Numbers

    Replacement

    E4=TEXTJOIN(",",TRUE,IF((Spares!C2:C100>=Replacement!B4)*(Spares!C2:C100<=Replacement!C4),Spares!B2:B100,""))

    Control+shift+enter

+ 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. Replies: 3
    Last Post: 03-18-2022, 01:58 PM
  2. [SOLVED] index/match multiple criterion returning accounts numbers with values over zero help
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-15-2021, 06:57 AM
  3. Extract all numbers from string, returning numbers to individual cells
    By LJBOS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2020, 08:46 AM
  4. Formula to look up two values before returning needed value?
    By loyalty3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-15-2013, 02:30 PM
  5. Replies: 3
    Last Post: 09-22-2012, 01:11 AM
  6. .Find Method Returning Incorrect Values For Whole Numbers
    By Steve0492 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-25-2012, 04:11 PM
  7. Prioritising Values - returning the top 3 numbers
    By Kolacube in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-23-2008, 02:23 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