Vlookup with multiple values

johnny52

Active Member
Joined
Oct 13, 2006
Messages
333
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
with PowerQuery (Get&Transform)

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td=bgcolor:#5B9BD5]Column2[/td][td=bgcolor:#5B9BD5]Column1[/td][td][/td][td=bgcolor:#70AD47]Column1[/td][td=bgcolor:#70AD47]Result[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]NY[/td][td=bgcolor:#DDEBF7]
1​
[/td][td=bgcolor:#DDEBF7]Tex[/td][td][/td][td=bgcolor:#E2EFDA]Tex[/td][td=bgcolor:#E2EFDA]2, 3[/td][/tr]

[tr=bgcolor:#FFFFFF][td]Tex[/td][td]
2​
[/td][td]Fla[/td][td][/td][td]Fla[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Tex[/td][td=bgcolor:#DDEBF7]
3​
[/td][td=bgcolor:#DDEBF7]NY[/td][td][/td][td=bgcolor:#E2EFDA]NY[/td][td=bgcolor:#E2EFDA]1[/td][/tr]
[/table]


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,223,952
Messages
6,175,596
Members
452,658
Latest member
GStorm

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