Formula to pull list from one column based on data in multiple columns

ltomlinson

New Member
Joined
Sep 9, 2014
Messages
23
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD]AUS
[/TD]
[TD]BOB
[/TD]
[TD]BOB
[/TD]
[TD]DREW
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]HOU
[/TD]
[TD]DREW
[/TD]
[TD]BOB
[/TD]
[TD]BOB
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DFW
[/TD]
[TD]DREW
[/TD]
[TD]NANCY
[/TD]
[TD]DREW
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CRP
[/TD]
[TD]BOB
[/TD]
[TD]NANCY
[/TD]
[TD]NANCY
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]NAS
[/TD]
[TD]NANCY
[/TD]
[TD]DREW
[/TD]
[TD]DREW
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Hoping someone can help with this. I have a spreadsheet like this

I need t be ale to pull the list of data in column A based on a give name. For instance, If I type in Bob, I want the list to return AUS,HOU, and CRP as those are the only ones is name has ever been associated with.

Please help me out here!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You will need Excel 2016 for function TEXTJOIN to work.


Book1
ABCDEFG
2CodeName1Name2Name3
3AUSBOBBOBDREWCriteriaCode
4HOUDREWBOBBOBBOBAUS, HOU, CRP
5DFWDREWNANCYDREW
6CRPBOBNANCYNANCY
7NASNANCYDREWDREW
Sheet21
Cell Formulas
RangeFormula
G4{=TEXTJOIN(", ",1,IF(MMULT(--(B3:D7=F4),TRANSPOSE(COLUMN(B3:D3)^0)),A3:A7,""))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I don't think it's easy without TEXTJOIN. Sorry.
 
Upvote 0
maybe...

A9=INDEX($A$2:$A$6,SMALL(IF(FREQUENCY(IF($B$2:$G$6<>"",IF($B$2:$G$6=$A$8,MATCH($A$2:$A$6,$A$2:$A$6,0))),ROW($A$2:$A$6)-ROW($A$2)+1),ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:A9))) Control Shift Enter

could wrap it in an IFERROR to get rid of the #NUM errors and adjust your ranges

[TABLE="class: grid, width: 448"]
<tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"]A[/TD]
[TD="width: 64"]B[/TD]
[TD="width: 64"]C[/TD]
[TD="width: 64"]D[/TD]
[TD="width: 64"]E[/TD]
[TD="width: 64"]F[/TD]
[TD="width: 64"]G[/TD]
[/TR]
[TR]
[TD="width: 64"]1[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
[TR]
[TD="width: 64"]2[/TD]
[TD="width: 64"]AUS[/TD]
[TD="width: 64"]BOB[/TD]
[TD="width: 64"]BOB[/TD]
[TD="width: 64"]DREW[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]HOU[/TD]
[TD]DREW[/TD]
[TD]BOB[/TD]
[TD]BOB[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]DFW[/TD]
[TD]DREW[/TD]
[TD]NANCY[/TD]
[TD]DREW[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]CRP[/TD]
[TD]BOB[/TD]
[TD]NANCY[/TD]
[TD]NANCY[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]NAS[/TD]
[TD]NANCY[/TD]
[TD]DREW[/TD]
[TD]DREW[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]nancy[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]DFW[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]CRP[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]NAS[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]#NUM ![/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]#NUM ![/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]#NUM ![/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Using Weazel's layout, here's another option for the A9 formula:

=IFERROR(INDEX($A$2:$A$6,SMALL(IF(MMULT(--($B$2:$D$6=$A$8),TRANSPOSE(COLUMN($B$2:$D$2))),ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:$A9))),"")

with Control+Shift+Enter.

Or if you only intend to ever have 3 name columns:

=IFERROR(INDEX($A$2:$A$6,SMALL(IF(MMULT(--($B$2:$D$6=$A$8),{1;1;1}),ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:$A9))),"")

with CSE.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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