lookup for multiple returns

y3tter

Board Regular
Joined
Nov 11, 2012
Messages
147
I have a workbook that has employee info in sheet1. Sheet2 lists the employees dependents with corresponding employees social security number in column A. Some employees have multiple dependents listed in multiple rows. Is there a formula that I can use in sheet1 to list each dependent in column, F, G, H, etc.?


Sheet1
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]111-11-1111[/TD]
[TD]Smith[/TD]
[TD]Jon[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]222-22-2222[/TD]
[TD]Wilson[/TD]
[TD]Dave[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]333-33-3333[/TD]
[TD]Char[/TD]
[TD]Jan[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]444-44-4444[/TD]
[TD]Page[/TD]
[TD]Chris[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Sheet2

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]111-11-1111[/TD]
[TD]Smith[/TD]
[TD]Kim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]111-11-1111[/TD]
[TD]Smith[/TD]
[TD]Syd[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]111-11-1111[/TD]
[TD]Smith[/TD]
[TD]Sandy[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]222-22-2222[/TD]
[TD]Wilson[/TD]
[TD]Jan[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]333-33-3333[/TD]
[TD]Char[/TD]
[TD]Sarah[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]333-33-3333[/TD]
[TD]Char[/TD]
[TD]Dave[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]444-44-4444[/TD]
[TD]Page[/TD]
[TD]Mike[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]444-44-4444[/TD]
[TD]Page[/TD]
[TD]Larry[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about


Excel 2013/2016
ABCDEFGH
1
2111-11-1111SmithJonKimSydSandy
3222-22-2222WilsonDaveJan
4333-33-3333CharJanSarahDave
5444-44-4444PageChrisMikeLarry
Sheet1
Cell Formulas
RangeFormula
F2=IFERROR(INDEX(sheet2!$C$2:$C$9,AGGREGATE(15,6,ROW(sheet2!$C$2:$C$9)-ROW(sheet2!$C$2)+1/(sheet2!$A$2:$A$9=$A2),COLUMNS($A:A))),"")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,203
Members
452,617
Latest member
Narendra Babu D

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