SOLVED
Home

How to display many results with using VLOOKUP

%3CLINGO-SUB%20id%3D%22lingo-sub-297101%22%20slang%3D%22en-US%22%3EHow%20to%20display%20many%20results%20with%20using%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297101%22%20slang%3D%22en-US%22%3EUsing%20VLOOKUP%20(I'm%20a%20newbie%20at%20it)%20and%20was%20wondering%20how%20to%20be%20able%20to%20display%20all%20the%20results%20from%20a%20contract%20number%20and%20show%20the%20invoices%20associated%20with%20it%20(one%20to%20many)%20in%20the%20cell.%20It's%20seems%20to%20pull%20the%20first%20of%20the%20invoices%20associated%20with%20the%20contract%20number%2C%20but%20not%20the%20others.%20The%20lookup%20is%20working%2C%20just%20not%20pulling%20all%20the%20info%20I'm%20looking%20for.%20My%20formula%20is%20below%3A%20My%20workbook%20has%20two%20tables%3A%20(I%20do%20have%20relationships%20created%20between%20the%20two%20tables%20as%20well)%20The%20%22Summary%22%20table%20is%20where%20I'm%20pulling%20the%20results%20into%20The%20%22Invoice%22%20table%20is%20where%20I'm%20pulling%20the%20list%20of%20invoices%20from.%20This%20as%20well%20is%20where%20the%20contract%20numbers%20are%20(hence%20the%20relationship%20between%20the%20two%20tables)%20%3DVLOOKUP(%5B%40%5BContract%3A%5D%5D%2Cprojectinvoicelist!%24A%242%3A%24B%2471%2C%202%2C%20FALSE)%20Thanks%20for%20any%20input%20or%20other%20recommendations!%20-Ben%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-297101%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-297516%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20display%20many%20results%20with%20using%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297516%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3Eand%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%2C%20Thank%20you%20gentlemen!%20That%20did%20the%20trick.%20Once%20I%20got%20the%20syntax%20right%2C%20it%20populated%20the%20fields%20perfectly!%20Thanks%20again!!%20Ben%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-297330%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20display%20many%20results%20with%20using%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297330%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Ben%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20VLOOKUP%20was%20found%20to%20live%20in%20the%20%3CEM%3E%3CSTRONG%3EMany%3C%2FSTRONG%3E%3C%2FEM%3Eside%2C%20not%20in%20the%20%3CEM%3E%3CSTRONG%3EOne%3C%2FSTRONG%3E%3C%2FEM%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20an%20example%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20969px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F62108i2D937020141448B4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22VLOOKUP%20%26amp%3B%20one-to-many.png%22%20title%3D%22VLOOKUP%20%26amp%3B%20one-to-many.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20above%20example%2C%20we%20have%20two%20tables%2C%20and%20the%20relationship%20between%20them%20is%20%3CEM%3E%3CSTRONG%3Eone-to-many%3C%2FSTRONG%3E%3C%2FEM%3E%2C%20where%20the%20one%20contact%20may%20get%20many%20invoices.%3C%2FP%3E%3CP%3EIn%20this%20case%2C%20you%20can%20use%20the%20VLOOKUP%20in%20the%20Invoices%20table%20to%20get%20the%20contact%20name%20for%20each%20invoice.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EThis%20is%20what%20VLOOKUP%20is%20good%20at!%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EVLOOKUP%20isn't%20helpful%20to%20what%20you%20asking%20for.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3ESo%2C%20you%20have%20to%20find%20out%20another%20approach%20to%20achieve%20what%20you%20want%20like%20the%20formula%20suggested%20by%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EYou%20can%20use%20it%20in%20the%20example%20above%20as%20follows%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2CIF(%24E%244%3A%24E%2413%3DA4%2C%24F%244%3A%24F%2413%2C%22%22))%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F62111iDED5CB58CF43C720%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22TEXTJOIN%20Example.png%22%20title%3D%22TEXTJOIN%20Example.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EBut%20please%20note%20that%20this%20is%20an%20array%20formula%2C%20so%20you%20have%20to%20press%20%3CEM%3E%3CSTRONG%3ECtrl%2BShift%2BEnter%3C%2FSTRONG%3E%3C%2FEM%3Eat%20the%20same%20time%20to%20enter%20it.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EAnd%20you%20need%20to%20Excel%202019%20or%20Office%20365%20installed%20in%20your%20machine%20to%20be%20able%20to%20use%20this%20formula%20because%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FTEXTJOIN-function-357b449a-ec91-49d0-80c3-0e8fc845691c%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETEXTJOIN%3C%2FA%3Eis%20only%20compatible%20with%20these%20versions.%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EHope%20that%20helps%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-297278%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20display%20many%20results%20with%20using%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297278%22%20slang%3D%22en-US%22%3ESergei%2C%3CBR%20%2F%3EThank%20you%20for%20your%20input!%20However%2C%20that%20didn't%20bring%20it%20in%20either.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-297114%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20display%20many%20results%20with%20using%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-297114%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Ben%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20TEXTJOIN%20available%20for%20your%20Excel%20version%20you%20may%20use%20the%20formula%20like%3C%2FP%3E%0A%3CPRE%3E%3DTEXTJOIN(%22%2C%22%2CTRUE%2CIF(projectinvoicelist!%24A%242%3A%24A%2471%3D%5B%40%5BContract%3A%5D%5D%2Cprojectinvoicelist!%24B%242%3A%24B%2471%2C%22%22))%3C%2FPRE%3E%0A%3CP%3Eabove%20is%20array%20formula%3C%2FP%3E%3C%2FLINGO-BODY%3E
Ben Wilson
Occasional Contributor
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 pull the first of the invoices associated with the contract number, but not the others. The lookup is working, just not pulling all the info I'm looking for. My formula is below: My workbook has two tables: (I do have relationships created between the two tables as well) The "Summary" table is where I'm pulling the results into The "Invoice" table is where I'm pulling the list of invoices from. This as well is where the contract numbers are (hence the relationship between the two tables) =VLOOKUP([@[Contract:]],projectinvoicelist!$A$2:$B$71, 2, FALSE) Thanks for any input or other recommendations! -Ben
4 Replies

Hi Ben,

 

If TEXTJOIN available for your Excel version you may use the formula like

=TEXTJOIN(",",TRUE,IF(projectinvoicelist!$A$2:$A$71=[@[Contract:]],projectinvoicelist!$B$2:$B$71,""))

above is array formula

Sergei,
Thank you for your input! However, that didn't bring it in either.
Solution

Hi Ben,

 

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

 

Here's an example:

VLOOKUP & one-to-many.png

 

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 @Sergei Baklan.

 

You can use it in the example above as follows:

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

TEXTJOIN Example.png

 

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 TEXTJOIN is only compatible with these versions.

 

Hope that helps

@Sergei Baklan and @Haytham Amairah, Thank you gentlemen! That did the trick. Once I got the syntax right, it populated the fields perfectly! Thanks again!! Ben