Listing names from a column into new columns under their relevant heading

Mazbuka

New Member
Joined
Sep 23, 2018
Messages
23
Office Version
  1. 365
Platform
  1. Windows
I have a big list of students in Col A & their school form in Col B. I list each unique form as column headers from C onwards and underneath each header I want the list of students in that form.

My data sample looks like this:

[TABLE="width: 191"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 232"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD]STUDENT[/TD]
[TD]FORM[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD]John[/TD]
[TD]Y01A[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD]Paul[/TD]
[TD]Y02C[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD]Mary[/TD]
[TD]Y01B[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD]June[/TD]
[TD]Y01A[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD]Mick[/TD]
[TD]Y02C[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD]Brian[/TD]
[TD]Y01B[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD]Karen[/TD]
[TD]Y02C[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD]Don[/TD]
[TD]Y01B[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD]Pat[/TD]
[TD]Y01B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


The resultant data needs to be listed as below:

[TABLE="width: 294"]
<colgroup><col><col><col span="3"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD]Y01A[/TD]
[TD]Y01B[/TD]
[TD]Y02C[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD]John[/TD]
[TD]Mary[/TD]
[TD]Paul[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD]June[/TD]
[TD]Brian[/TD]
[TD]Mick[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD]Don[/TD]
[TD]Karen[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]Pat[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How about

+Fluff 1.xlsm
ABCDE
1STUDENTFORMY01AY01BY02C
2JohnY01AJohnMaryPaul
3PaulY02CJuneBrianMick
4MaryY01B DonKaren
5JuneY01A Pat 
6MickY02C   
7BrianY01B
8KarenY02C
9DonY01B
10PatY01B
11
12
Main
Cell Formulas
RangeFormula
C2:E6C2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($A$2:$A$10)-ROW($A$2)+1)/($B$2:$B$10=C$1),ROWS($A$2:$A2))),"")
 
Last edited:
Upvote 0
Solution
Edit: Looks like I was a fraction slow. :)

Try this copied across and down.

Excel Workbook
ABCDE
1STUDENTFORMY01AY01BY02C
2JohnY01AJohnMaryPaul
3PaulY02CJuneBrianMick
4MaryY01BDonKaren
5JuneY01APat
6MickY02C
7BrianY01B
8KarenY02C
9DonY01B
10PatY01B
11
List
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,980
Members
452,540
Latest member
haasro02

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