+ Reply to Thread
Results 1 to 5 of 5

Return multiple rows - should I be using VLOOKUP?

  1. #1
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Return multiple rows - should I be using VLOOKUP?

    With TABLE1, my data is laid out as follows. One thing to keep in mind is that sometimes, A1 and A2 may be merged (which has caused me headaches with formulas).

    TABLE1 (on worksheet1)
    A B
    1 TEST1 Completed sample1
    2 Finish work papers
    3 PROJECT4 Submit RFP
    4 PROJECT7 Submit RFP
    5 TEST8 Gather sample data
    6 Submit data to supervisor

    I then would like to have another table on another worksheet that looks like this. You can see how it gets everything from TABLE1 column B related to TEST1. The reason for the blank row is that there may at times be more than just two items in column B on TABLE1. I would still want to be able to copy the formula into A4, but if there is no associated data, it would be blank.

    TABLE2 (on worksheet2)
    A
    1 TEST1
    2 Completed sample 1
    3 Finish work papers
    4

    Is the best way to achieve this using VLOOKUP? I can figure out how to do it with a formula similar to "=VLOOKUP($A$1,TABLE1,2,FALSE)" for TABLE2 cell A2, but just copying it to A3 produces the same data in A2 (Completed sample 1) instead of the data I really want. I would like to use the same formula in A2, A3, and A4 without having to change it (but I could if that's the only way).

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Return multiple rows - should I be using VLOOKUP?

    It would help if you attached a sample Excel workbook. The yellow banner at the top of the screen gives details of how to do this.

    I think it would be better to use a helper column on Table1 which helps to identify those records which have a blank in column A, and then you can use INDEX/MATCH instead of VLOOKUP in Table2 to get the full list of records (in conjunction with the ROWS function).

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Re: Return multiple rows - should I be using VLOOKUP?

    Think I got the formula working after your suggestion. Uploaded a sample. If you look on worksheet A4, cells B15:B17 all have a index. Works on A4. On worksheet PC2, it works fine in B15 and B16, but B17 should have something in it since PC2 has 3 rows on 'Master Matrix' worksheet. Can't figure it out.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Return multiple rows - should I be using VLOOKUP?

    I'm just about to have a break now for several hours. I'll check back later to see if anyone else has responded.

    Pete

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Return multiple rows - should I be using VLOOKUP?

    Please try

    =IFERROR(INDEX('Master Matrix'!$F$3:$F$75,SMALL(IF($B$1='Master Matrix'!$A$3:$A$75,ROW('Master Matrix'!$A$3:$A$75)-ROW($A$2)),ROWS(B$15:B15))),"")
    Attached Files Attached Files

+ 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. Vlookup to return multiple rows in return
    By Excelhelpss in forum Excel General
    Replies: 1
    Last Post: 06-18-2015, 09:59 AM
  2. Help - VLookup formula written, but need to return data on multiple rows
    By thelmacottonwood in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2012, 09:56 PM
  3. Vlookup to return multiple rows
    By macaonghus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2012, 11:09 AM
  4. vlookup formula to return multiple rows of data based on the same value.
    By Point5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2011, 06:03 PM
  5. VLookUp function to return multiple rows
    By sebastian stephenson in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-20-2006, 01:30 PM
  6. [SOLVED] VLOOKUP to return multiple rows
    By Miss Marple in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2005, 06:18 AM
  7. VLOOKUP to return multiple rows
    By Miss Marple in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-19-2005, 04:06 AM

Tags for this Thread

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