+ Reply to Thread
Results 1 to 5 of 5

Vlookup on multiple matches in multple ranges

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    Kerry, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    17

    Vlookup on multiple matches in multple ranges

    Hi,

    I've information in two sections of a worksheet, columns A and B (range named "temp1") and columns D and E (range named "temp2"). I should also say that the reason I have two sections is that each section will have about 150 rows, so instead of having a huge list of 300 rows, I've tried splitting them into two sections.
    A B
    1 a
    1 b
    3 c

    D E
    4 d
    1 e
    6 f

    What I want to do it show all the results that match the value 1 using a vlookup formula. Also the values in column A and D may change, i.e if value 4 in D1 changed to 1, I would expect to see "d" included in the results.

    This is the original formula I got somewhere else which sorts out my vlookup on multiple matches issue.
    Please Login or Register  to view this content.
    I've updated it to search on each range seperately which works ok but it only returns values from one range, not both and visa versa. It is an array entered formula. In a nutshell, this formula checks if there is an error performing the lookup on range "temp1". If there is an error, it searches range "temp2". If no error, it searches range "temp1".
    Please Login or Register  to view this content.
    I have a number of tables based on the values in columns A and D that will perform the lookup which should return the following results. I haven't put in all the tables. This is the result I want to get.
    H I
    1 a
    1 b
    1 e

    J K
    3 c
    3
    3

    This is the result I'm currently getting when doing a lookup on value 1.
    H I
    1 a
    1 b
    1 #NUM!

    Sorry if this confuses everyone! Ask for more details if needed. I've tried to give as much info as possible.

    Any ideas on how to also search on the other range?
    Thanks.
    Last edited by sflemings; 01-20-2010 at 09:49 AM. Reason: Changed status to SOLVED

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,599

    Re: Vlookup on multiple matches in multple ranges

    Can you upload example?

  3. #3
    Registered User
    Join Date
    08-20-2009
    Location
    Kerry, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup on multiple matches in multple ranges

    That probably would help alright. File is attached.
    The only values that I would be changing is in columns A and D.
    I won't be changing any values in columns H, J, L or N

    I've changed the formula I'm using slightly. I've put the ISERROR check around the whole VLOOKUP function instead of being inside it. I haven't attached the new file though.
    Please Login or Register  to view this content.
    Last edited by sflemings; 01-20-2010 at 08:35 AM.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Vlookup on multiple matches in multple ranges

    Realistically you're looking at a hideous formula...

    Using your sample file, to utilise below suggestion, you would first need to ensure you have a header row above first result such that existing row 1 becomes row 2

    With the blank header row in place:

    Please Login or Register  to view this content.
    I2:I4 can be copied to K, M, O

    does that work for you ?

    EDIT:
    I just noticed (13:07 UK time) that when I copied across I failed to update a couple of cell references which should both have read H2 (I was testing in a different range) - above has been corrected.
    Last edited by DonkeyOte; 01-20-2010 at 09:05 AM.

  5. #5
    Registered User
    Join Date
    08-20-2009
    Location
    Kerry, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Vlookup on multiple matches in multple ranges

    Genius. That worked. Thanks for the hideous formula!

+ 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