Vlookup to return multiple values in same cell

KimC2504

Board Regular
Joined
Jul 17, 2012
Messages
141
Hi All,

Traditionally the vookup will return the first value it can match. I can return multiple values on different lines using an array formula but this is not useful.

In the example below I have table array A1:B8. Lookup criteria in cell A11 and want to return MULTIPLE values from column B in cell B11.

Any suggestions? I would prefer to not use VBA if possible
A
B
1
A1
Red
2
A1
Blue
3
A1
Green
4
A2
Purple
5
A2
Orange
6
A3
Yellow
7
A4
Black
8
A5
White
9
10
Lookup
11
A1
Red, Blue, Green

<TBODY>
</TBODY>
 
I am thrilled to report that NOW there is a function that can do this. In the new version of Excel 2016 with the Feb updates, function TEXTJOIN gets it done:

AB
1A1Red
2A1Blue
3A1Green
4A2Purple
5A2Orange
6A3Yellow
7A4Black
8A5White
9
10Lookup
11A1Red; Blue; Green

<tbody>
</tbody>
Sheet3

Array Formulas
CellFormula
B11{=TEXTJOIN("; ",1,REPT($B$1:$B$8,1*($A$1:$A$8=A$11)))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Could someone please attach a working excel file with the above formula of TEXTJOIN
I am starting to wonder is my Excel is functioning properly, maybe some update issue.
Cuz I can't get it to work
 
Upvote 0
Can you uses something like this? First in cell D1 place formula to isolate colors for A1. I put the =iferror(formula...." ") to get rid error messages after you get all your results. Then I use a concatenate transpose formula for end result. In DI I have
=IFERROR(INDEX($B$1:$B$8,SMALL(IF($A$1:$A$8=$A$11,ROW($B$1:$B$8)-ROW($B$1)+1),ROWS($D$1:D1)))," ") Use Cntrl+Shift+Enter

I place my concatenation formula in B11. Before entering you need to highlight the transpose part of the formula with your mouse. Hit F9. Now remove the { and }. Hit enter.

My formula in B8 is =concatenate(transpose(D1:D3&", ")). Do the F9 step, then enter

<tbody>
</tbody>



A1RedRed
A1BlueBlue
A1GreenGreen
A2Purple
A2Orange
A3Yellow
A4Black
A5White
A1Red, Blue, Green,

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Last edited:
Upvote 0
Nop
 
Last edited:
Upvote 0
Jointext is an UDF no ? : Personnal function
From where you got it ??
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,706
Members
449,118
Latest member
MichealRed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top