+ Reply to Thread
Results 1 to 8 of 8

Can VLOOKUP return multiple non-empty values from a table?

Hybrid View

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    Wheaton, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Smile Can VLOOKUP return multiple non-empty values from a table?

    I have a table.
    The table has a list of components down column A, one component per row.
    The table has a list of products across the top row, one product per column.
    If the component appears in a product, there is an X in the table. Otherwise, the table cel is empty.

    Is there a way that I can do a VLOOKUP on the component value, and have Excel return the names of each product in which the component appears?

    That is, for a given component (row),
    I want to know every product (column)
    that contains a value of X (or non-empty cel).

    VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
    I understand that this would require manipulation of the "col_index_num" field.

    Thanks for any feedback!
    Last edited by marathon; 01-20-2012 at 05:51 PM.

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Can VLOOKUP return multiple non-empty values from a table?

    Hello marathon, Welcome to the forum.

    Can you please attach a dummy file with desired outcome? So we can see your data layout. go to bottom click on Go Advanced, then click on Manage Attachments & browse & upload it.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    01-19-2012
    Location
    Wheaton, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Can VLOOKUP return multiple non-empty values from a table?

    Hello, Haseeb,

    Thank you for the reply and the welcome. I hope to learn much from the forum, and also contribute.
    As suggested, I have uploaded a dummy file, "table_example.xls," attached here.

    I typically use Excel 2010 on Windows 7, though Excel 2008 for Mac is available at my current location.
    The dummy file was created using the latter. Best wishes, Jeff
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-19-2012
    Location
    Wheaton, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Can VLOOKUP return multiple non-empty values from a table?

    p.s. I'll cross-post this question to techarena, and may post in mrexcel.com. If I receive a helpful reply on any forum, I shall share that information on the other forums, with due credit. I'll also mark these threads as solved once a solution can be described.

    The techarena thread is here.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Can VLOOKUP return multiple non-empty values from a table?

    Try:

    =IFERROR(INDEX($B$1:$F$1,SMALL(IF(INDEX($B$2:$F$6,MATCH($B$8,Component_List,0),0)="x",COLUMN($B$1:$F$1)-COLUMN($B$10)+1),COLUMNS($B$1:B$1))),"")
    confirmed with CTRL+SHIFT+ENTER not just ENTER and copy across.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  6. #6
    Registered User
    Join Date
    01-19-2012
    Location
    Wheaton, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Thumbs up Re: Can VLOOKUP return multiple non-empty values from a table?

    NBVC, your Excel wizardry is much appreciated. I'll dissect your solution in order to learn more.
    This thread is solved, and I shall mark the thread accordingly as soon as my newbie brain can identify the Prefix dropdown described in the FAQ. Thank you.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Can VLOOKUP return multiple non-empty values from a table?

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Registered User
    Join Date
    01-19-2012
    Location
    Wheaton, IL
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Can VLOOKUP return multiple non-empty values from a table?

    Thanks for holding my hand on the "mark solved" question, NBVC. Got it!

+ 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