Vlookup with multiple values

johnny52

Active Member
Joined
Oct 13, 2006
Messages
332
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
Lets say I have a worksheet consisting of 3 columns and 3 rows

row a1=NY row a2 =Tex row a3 =Tex
row b1=1 row b2=2 row b3 =3
row c1=Tex c2=Fla row c3= NY

my question is I would like to use a vlookup or match or an idex formula in D1 to return multiple values

if I use vlookup(c1,a1:b3,2,false) in col d1 i get the results 2 ( the first value it finds)

I would like a formula showing the Tex value from the entire range in one cell so in d1 the results would be 2,3

Is it possible.......Thanks everybody
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
with PowerQuery (Get&Transform)

Column1Column2Column1Column1Result
NY
1​
TexTex2, 3
Tex
2​
FlaFla
Tex
3​
NYNY1

Code:
[SIZE=1]// Result
let
    tbl1 = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    tbl2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    Source = Table.NestedJoin(tbl2,{"Column1"},tbl1,{"Column1"},"tbl1",JoinKind.LeftOuter),
    List = Table.AddColumn(Source, "Result", each Table.Column([tbl1],"Column2")),
    Extract = Table.TransformColumns(List, {"Result", each Text.Combine(List.Transform(_, Text.From), ", "), type text})
in
    Extract[/SIZE]
 
Upvote 0
that macro works....great

would there be a formula available as well....I want to use it on multiple worksheets,with varying parameters
 
Upvote 0
=IFERROR(INDEX($B$3:$B$13,SMALL(IF($C3=$A$3:$A$13,ROW($B$3:$B$13)-2,""),COLUMN()-4)),"")

ok I found an array formula that does the trick the data ranges are a bit different....but they can be modified........Thanks for all your help
 
Upvote 0

Forum statistics

Threads
1,215,515
Messages
6,125,279
Members
449,220
Latest member
Excel Master

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