+ Reply to Thread
Results 1 to 11 of 11

Thread: Lookup between 2 ranges

  1. #1
    Registered User
    Join Date
    08-19-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Lookup between 2 ranges

    Hi im currently trying to lookup the value in column G in the from and to columns (B4 and C4 down) and return the corresponding date from column D into cell H. Any help will be greatly appreciated. The dates are in order but the other values are not in any order.

    Thanks
    Attached Files Attached Files

  2. #2
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Lookup between 2 ranges

    Hi and welcome to the board

    First sort the From column Ascending then enter
    =LOOKUP(G3,$B$4:$B$25,$D$4:$D$25)
    in H3 and pull down as needed
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,225

    Re: Lookup between 2 ranges

    Sort first column and:

    =VLOOKUP(G3, $B$4:$D$25, 3, TRUE)
    "Relax. What is mind? No matter. What is matter? Never mind!"

  4. #4
    Valued Forum Contributor
    Join Date
    05-23-2011
    Location
    Lahore PK
    MS-Off Ver
    Excel 2007
    Posts
    615

    Re: Lookup between 2 ranges

    use

    =INDEX($D$4:$D$25,MATCH(RIGHT(G3,5),INDEX(RIGHT($B$4:$B$25,5),0))) and copy down

    see the attatch file
    Attached Files Attached Files
    Azam
    If you want to say Thank you to a member, click the reputation icon (Star) in the left bottom of the post.
    For prompt answer, be descriptive, concise, short, direct, and to-the-point.

  5. #5
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Lookup between 2 ranges

    Azam, what is the point using 3 functions when one will do?
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  6. #6
    Valued Forum Contributor
    Join Date
    05-23-2011
    Location
    Lahore PK
    MS-Off Ver
    Excel 2007
    Posts
    615

    Re: Lookup between 2 ranges

    it is my mistake

    the function given by you is correct solution
    Azam
    If you want to say Thank you to a member, click the reputation icon (Star) in the left bottom of the post.
    For prompt answer, be descriptive, concise, short, direct, and to-the-point.

  7. #7
    Registered User
    Join Date
    08-19-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup between 2 ranges

    Can i sort the columns so they data in the From, To and Date all stay together. As in the dates correspond to that data range and i need it to sort together

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,225

    Re: Lookup between 2 ranges

    Put mouse in B column
    select all (Ctrl+A)
    Sort (Right click -> Sort A->Z)
    "Relax. What is mind? No matter. What is matter? Never mind!"

  9. #9
    Registered User
    Join Date
    08-19-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup between 2 ranges

    Doesnt that sort each individual column from a-z

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,225

    Re: Lookup between 2 ranges

    Try and see..

    That will sort B column but if you select all data it will keep values in the same rows.
    If you take only B column it will sort only B without moving other data.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  11. #11
    Registered User
    Join Date
    08-19-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup between 2 ranges

    All sorted, thank you very much for the help all

+ 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.2.0