Forum Discussion

Ben Wilson's avatar
Ben Wilson
Brass Contributor
Dec 06, 2018
Solved

How to display many results with using VLOOKUP

Using VLOOKUP (I'm a newbie at it) and was wondering how to be able to display all the results from a contract number and show the invoices associated with it (one to many) in the cell. It's seems to ...
  • Haytham Amairah's avatar
    Dec 07, 2018

    Hi Ben,

     

    The VLOOKUP was found to live in the Many side, not in the One.

     

    Here's an example:

     

    In the above example, we have two tables, and the relationship between them is one-to-many, where the one contact may get many invoices.

    In this case, you can use the VLOOKUP in the Invoices table to get the contact name for each invoice.

    This is what VLOOKUP is good at!

     

    VLOOKUP isn't helpful to what you asking for.

    So, you have to find out another approach to achieve what you want like the formula suggested by SergeiBaklan.

     

    You can use it in the example above as follows:

    =TEXTJOIN(", ",TRUE,IF($E$4:$E$13=A4,$F$4:$F$13,""))

     

    But please note that this is an array formula, so you have to press Ctrl+Shift+Enter at the same time to enter it.

    And you need to Excel 2019 or Office 365 installed in your machine to be able to use this formula because https://support.office.com/en-us/article/TEXTJOIN-function-357b449a-ec91-49d0-80c3-0e8fc845691c is only compatible with these versions.

     

    Hope that helps

Resources