Match and return multiple results in one cell

jeffingle

New Member
Joined
Mar 31, 2016
Messages
2
I have a spreadsheet of students assigned to a specific teacher on a specific day for tutoring and I would like to create a single sheet that list all teachers individually in a row and then shows the students assigned to them for each day. I have tried VLOOKUP, MATCH, INDEX with no luck.

Data I am pulling from.
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
MONTUEWEDTHUSTUDENT
Mr. SmithMr. SmithLibraryMrs. JonesJohn Doe
Mrs. JonesMrs. JonesLibraryLIbraryJane Doe
Mr. SmithMr. DoeMrs. JonesComp LabJohn Smith

<colgroup><col style="width: 120px"><col width="120"><col width="120"><col width="120"><col width="120"></colgroup><tbody>
</tbody>

Desired Results
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
MONTUEWEDTHU
Mr. SmithJohn Doe
John Smith
John Doe
Mrs. JonesJane DoeJane DoeJohn SmithJohn Doe
Mr. DoeJohn Smith
LibraryJohn Doe
Jane Doe
Jane Doe
Comp. LabJohn Smith

<colgroup><col style="width: 120px"><col width="120"><col width="120"><col width="120"><col width="120"></colgroup><tbody>
</tbody>

Thanks in advance for the help.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you have a newer version of Excel with the TEXTJOIN function, it's relatively easy:

ABCDE
1MONTUEWEDTHUSTUDENT
2Mr. SmithMr. SmithLibraryMrs. JonesJohn Doe
3Mrs. JonesMrs. JonesLibraryLIbraryJane Doe
4Mr. SmithMr. DoeMrs. JonesComp. LabJohn Smith
5
6
7Desired Results
8MONTUEWEDTHU
9Mr. SmithJohn Doe, John SmithJohn Doe
10Mrs. JonesJane DoeJane DoeJohn SmithJohn Doe
11Mr. DoeJohn Smith
12LibraryJohn Doe, Jane DoeJane Doe
13Comp. LabJohn Smith

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
B9{=TEXTJOIN(", ",TRUE,IF(A$2:A$4=$A9,$E$2:$E$4,""))}

<thead>
</thead><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>

Put the formula in B9, change the ranges to match your sheet, then confirm by pressing Contol+Shift+Enter. Then drag down and to the right as needed.

If you don't have TEXTJOIN, you'll need to use VBA in some fashion.

Let me know how this works for you.
 
Upvote 0

Forum statistics

Threads
1,218,220
Messages
6,141,231
Members
450,344
Latest member
renslaw

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