## [Solved] Formula question - Creating a classroom roster

### [Solved] Formula question - Creating a classroom roster

I'm working on a schedule for my school, and need to create individual classroom rosters for each teacher.

I'm working on a spreadsheet where I have a column for "teacher name", and one for "student name". I would like to create a function that will print the value in "student name" based on the value in "teacher name".

Is there any way I can create a function that will look at the teacher column, and for each instance of teacher x's name, print the name of the student taking that class? What I would end up with are class lists for each individual teacher.

Any help on this would be greatly appreciated. Thanks!
Last edited by Hagar Delest on Tue Jun 10, 2008 2:22 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
clemmert

Posts: 2
Joined: Mon Jan 21, 2008 6:12 pm

### Re: Formula question - Creating a classroom roster

I'm not sure I understand your question but let's get started.

Let's say in C1:D4 you have the following for teachers (very short named ones) and students:
A Bill
B Mary
C Tod
A Alice

In cell A1 you can enter A,B or C and in B1 you can put
=VLOOKUP(A1;C1:D4;2;0) to return the 1st students name in this list for the teacher but with this list you will never return Alice only Bill for teacher A.

To get a list of who's in A's class select the two list columns and do Data > Sort and just click OK. The teacher names will be sorted alphabetically and you can copy and paste each teacher and his/her students someplace else.

Does this help?
JohnV
Volunteer

Posts: 1585
Joined: Mon Oct 08, 2007 1:32 am
Location: Kentucky, USA