+ Reply to Thread
Results 1 to 19 of 19

Range Lookup

Hybrid View

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Range Lookup

    Hello,

    I'm trying to figure out how to do this, so I'm asking the experts. I'm wanting to determine if a number falls between a range. For example, I have the following
    E6:G6
    200 000 000 000 000 200 000 000 000 999 Test

    E7:G6
    200 100 000 000 000 200 100 000 200 999 Test 2


    If I have 200 100 000 000 888 in A1, is there a way to return which range it's in? (Test or Test2)?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Which range is it in? Can't tell from your post where one cell ends and another begins. Can you upload an example workbook (Go advanced> Manage Attachments) showing what you have and what you want?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    Wow,

    I'm sorry about that. It does look confusing. Thank you for the quick response by the way.

    Book1.xlsx

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    That's better. Based on what you've given, let us know if this formula works on a larger set of data

    =LOOKUP(SUBSTITUTE(A1," ","")+0,SUBSTITUTE($E$6:$E$7," ","")+0,$G$6:$G$7)

  5. #5
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    Thanks. Impressive formula. It appears it works but only 90% probably because I've left something out that I didn't think to provide.

    Book1.1.xlsx

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    How about this one?

    =IF(SUBSTITUTE(A1," ","")+0>LOOKUP(1E+100,SUBSTITUTE($F$2:$F$14," ","")+0),"N/A",LOOKUP(SUBSTITUTE(A1," ","")+0,SUBSTITUTE($E$2:$E$14," ","")+0,$G$2:$G$14))

  7. #7
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    That's crazy fast. I really feel like I'm bothering you now LOL. I explained more in the doc. Book1.2.xlsx

  8. #8
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    It would've helped if I updated it to show you what I was referring to.

    Book1.3.xlsx

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Hmmmm, maybe this

    =IF(SUMPRODUCT(--(SUBSTITUTE($E$2:$E$7," ","")+0<=SUBSTITUTE(A1," ","")+0),--(SUBSTITUTE($F$2:$F$7," ","")+0>=SUBSTITUTE(A1," ","")+0))>0, LOOKUP(SUBSTITUTE(A1," ","")+0, SUBSTITUTE($E$2:$E$7," ","")+0,$G$2:$G$7),"N/A")
    See attachment
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    Posted too soon on this. I'm killing you I know. I really do appreciate you attempting this. This is a crazy request. Just so close.

    Book1.7.xlsx
    Last edited by vzwtester; 05-02-2013 at 04:48 PM.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Yes, Column E needs to be sorted from lowest to highest (just select E,F and G and Custom Sort on E)
    for the LOOKUP to work
    Is it fesible for you to sort or do you need a new formula?

  12. #12
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    Is there a way to ignore the #values?

  13. #13
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    It is highly possible that I'm doing something wrong. I'm sorting, off E, but 200 200 009 100 444 shows as Test 6 when it should show Test.

  14. #14
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    Yep. I think it was me . I'll keep testing it. I really do appreciate your mad skills.

  15. #15
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Put an IFERROR around the formula
    =IFERROR( your formula, "")
    will put a blank ("") instead of an error

  16. #16
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    =IFERROR(IF(SUMPRODUCT(--(SUBSTITUTE($D$2:$D$14," ","")+0<=SUBSTITUTE(A2," ","")+0),--(SUBSTITUTE($E$2:$E$14," ","")+0>=SUBSTITUTE(A2," ","")+0))>0, LOOKUP(SUBSTITUTE(A2," ","")+0, SUBSTITUTE($D$2:$D$14," ","")+0,$F$2:$F$14),"N/A","")
    Like that?

  17. #17
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Almost. Still need a parentheses after the last "N/A" before the ","

  18. #18
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Range Lookup

    That worked of course. Thanks again! I'll mark this as Solved.

  19. #19
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Lookup

    Glad I could help.

+ 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