Sampling a Sample in Excel

sam31511

New Member
Joined
Aug 24, 2011
Messages
2
Imagine a school with 100 teachers and 30 students per teacher.
So 300 individual students, each with a row of data. 100 individual teachers, with multiple students assigned to each one.
My data will not be as clean as 30 per teacher, it can be as little as 1 on up to hundreds.

What I need to be able to do, is generate a random sample of students, but only 1 student per 1 teacher.

So what I need is to randomly select 15 of the 100 teachers, then randomly select 1 of the 30 students for each of the 15 teachers.
Which would get me 15 random students, no repeats of teachers.

I downloaded and installed the Data Analysis Add-In, and I've used the Sample feature to generate random lists of 15 students or 15 teachers. But my problem is, when I generate 15 teachers, I only get the 1st student for each of the 15 teachers. OR I get 15 random students but sometimes I get a repeat of a teacher.

My data looks something like:
Teacher - Student
-------------------------
Mr. Brown - Johnny Smith
Mr. Brown - Grey Thomas
Mr. Brown - Yvette Doe
Mr. White - Gray Raven
Mr. White - Timmy Scott
Mr. White - Tiger Woods
Mr. Yellow - Billy Bobb
Mr. Yellow - Fanny May
Mr. Yellow - Chung Li
Mr. Black - Devon Grimes
Mr. Black - Promila Goode
Mr. Black - Velma Treat
Mr. Green - Horace Gum
Mr. Green - Brenda Fish
Mr. Green - Barry Spray
Mr. Purple - Woody Jones
Mr. Purple - Libby Williams
Mr. Purple - Gabby Martin

If I were Generating 5 Random Teachers, I could get:
Teacher - Student
-------------------------
Mr. Brown - Johnny Smith
Mr. Black - Devon Grimes
Mr. White - Gray Raven
Mr. Black - Devon Grimes
Mr. Black - Devon Grimes

Problem is Student is repeating (Or if not repeating, it is no longer random)

Or if I Generate 5 Random Students, I could get:
Teacher - Student
-------------------------
Mr. Brown - Johnny Smith
Mr. Yellow - Chung Li
Mr. Black - Velma Treat
Mr. White - Tiger Woods
Mr. Brown - Yvette Doe

Problem with this is the Teacher has a repeat.

I need a unique 15 random Teachers. Then for however many Students there are for the teacher, I need 1 random student selected per each random Teacher.

15 Unique Teachers, 1 Student Randomly selected per teacher.
Is this possible?:confused::confused::confused::eeek:
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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