Randomly Select Records

G

Guest

I need a way to randomly select 400 records from a worksheet containing
around 2000. Is there a formula or function that will do this?
 
G

Guest

Say your data is in A1 thru A2000

1. in B1 thru B2000 enter:
=RAND()
2. sort columns A & B by column B
3. pick the first 400 items in column A
 
G

Guest

When I use your formula, it is generating only large decimal numbers that
aren't sorting correctly. Is there something to add to the formula so that
it will generate whole numbers only?
 
G

Guest

Whole numbers would be bad. Here is a 10 item example (instead of 2000) in
A1 thru B10:

first record 0.101136315
second record 0.261871674
third record 0.256612485
fourth record 0.37613248
fifth record 0.869187556
sixth record 0.601846916
seventh record 0.316891978
eighth record 0.239924396
nineth record 0.022173703
tenth record 0.414456984


and after the sort:

nineth record 0.022173703
first record 0.101136315
eighth record 0.239924396
third record 0.256612485
second record 0.261871674
seventh record 0.316891978
fourth record 0.37613248
tenth record 0.414456984
sixth record 0.601846916
fifth record 0.869187556


As you see the order of records in column A is randomized. Just get the top
4 or 400 for your sample.
 
G

Guest

One variation to play with ..

Assume your source records is in A1:A2000

Place in B1: =RAND()
Copy down to B2000

Then place in say, C1:
=INDEX(A:A,RANK(B1,$B$1:$B$2000))
Copy C1 down by 400 rows to C400

C1:C400 will return 400 random, non-duplicating picks
from the source within A1:A2000

Press F9 to re-generate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top