View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Random Sample with multiple data points

Say we have 20 "Mike" lines, then 10 "James" lines, then 50 "Sally" lines, etc.

It does not matter if the lines are grouped together or not. In an un-used
column (say column Z), enter:

=RAND() and copy down

First the table by column Z. This will randomize the records. Then sort
the table by column C. This will group the names together, but in a random
order. All the "Mike"s will be grouped, but the order of the "Mike"s
shuffled.

Then just take the first two "Mike"s, the first two "James"s, etc.
--
Gary''s Student - gsnu200847


"Jeremy" wrote:

I have a list of people with a large number of lines per person. I need to
randomly select two lines for each person. The report is preformatted and
downloaded daily. The names are listed in column C. How can I do this?