Creating Rosters/registers

Carvell

New Member
Joined
May 21, 2016
Messages
17
Hello,
I have a table which tells me which class a student is in

StudentGroup1Group2Group3Group4
StudentA2346
StudentB3417
StudentC6542
StudentD2371

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>

I would like to change this into a list of students in each class

Class1234567
Student

<colgroup><col width="64" style="width:48pt" span="8"> </colgroup><tbody>
</tbody>

Below each number I would like a list of the students in that class

So below class 1 it would say StudentA and then the row below would say StudentD

I can create the lists using COUNTIF but I end up with blank rows (which I don't want)

Is there a formula, that can make this from the table above?

Class1234567
StudentStudentBStudentAStudentAStudentAStudentCStudentAStudentD
StudentDStudentCStudentBStudentBStudentC
StudentDStudentDStudentC

<colgroup><col width="64" style="width:48pt" span="8"> </colgroup><tbody>
</tbody>

Thank you
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How about


Excel 2013/2016
ABCDEFJKLMNOPQ
1StudentGroup1Group2Group3Group4Class1234567
2StudentA2346StudentStudentBStudentAStudentAStudentAStudentCStudentAStudentB
3StudentB3417StudentDStudentCStudentBStudentBStudentCStudentD
4StudentC6542StudentDStudentDStudentC
5StudentD2371
Sheet2
Cell Formulas
RangeFormula
K2=IFERROR(INDEX($A$2:$A$5,AGGREGATE(15,6,(ROW($A$2:$A$5)-ROW($A$2)+1)/($B$2:$E$5=K$1),ROWS($A$1:$A1))),"")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
That’s okay.

Is it possible to explain how it’s working.

Also, I’m pretty sure this is moving into the world of VBA (which I have no understanding). Is it possible from my original table to make a new worksheet for each unique class name and then add the student list?

Thanks
 
Upvote 0
This part of the formula
(ROW($A$2:$A$5)-ROW($A$2)+1)
returns an array of of numbers {1;2;3;4} representing the rows so A2 is the 1st row A3 the 2nd etc
This part
($B$2:$E$5=K$1)
returns an array of TRUE or FALSE depending on whether a cell matches the criteria in K1
The array of rows is then divided by the array of true/false which gives either a Div0 error or the row number.
This parrt
ROWS($A$1:$A1)
returns the number of rows, so in K2 it returns 1, in K3 it returns 2etc
This
AGGREGATE(15,6,...
Is the same as the SMALL function except it ignores errors, so in K2 it will return the smallest non error value.

If you select the cell with the formula & click "Evaluate Formula" on the Formulas tab, you can see it working each part out.

You will need to start a new thread for your other question.
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

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