Random Sample

M

Matthew

I have a wrksheet containing 30,000 records. Is there a
way to have excel generate a random sample of a specified
number from this? Any direction or advice is greatly
appreciated. Thanks.

Matthew.
 
F

Frank Kabel

Hi
one way:
- in a helper column enter the formula
=RAND()
- copy this formula down for all rows
- sort the data with this helper column
- copy the required number of data (the first x rows of
data)
 
B

Bernard Liengme

Insert a new A column
Fill the 30000 cells with =RAND()
Use Copy|Paste Special (Values) on this column
Sort you data base (with column A)
Take the top N for N random samples.

To do repeatedly, record a VBA macro.

Best wishes
Bernard
 
S

sulprobil

Take my function UniqRandInt() from
http://www.sulprobil.com/html/random_numbers.html

(Copy it, change to your excel file, press ALT+F11, and
paste)

Select a range (size equal to desired number of random
rows you like to get), enter =UniqRandInt(30000)
CTRL+SHIFT+ENTER (array formula) and select rows of your
table which correspond to resulting random numbers.

Regards,
sulprobil
 

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