View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Randomly Select Records

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.
--
Gary''s Student
gsnu200710


"Critzy" wrote:

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?

"Gary''s Student" wrote:

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
--
Gary''s Student
gsnu200710


"Critzy" wrote:

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?