Pick data from an array

W

Winston Williams

How do I randomly pick a set of numbers out of an array? I have 5 columns
and 10 rows of data and I want to randomly pick 5 numbers out of this data
set how do I do that?
 
T

Toppers

one way:

Put in a cell and copy down to fill 5 cells:

=LARGE($A$1:$E$10,INT(RAND()*50+1))

HTH
 
T

Toppers

Change the range and change 50 to number of cells in range

e.g if range is 8 columns and 15 rows (120 cells in total ) then 50 becomes
120:

=LARGE($A$1:$H$15,INT(RAND()*120+1))
 
R

Rick Rothstein \(MVP - VB\)

Change the range and change 50 to number of cells in range
e.g if range is 8 columns and 15 rows (120 cells in total ) then 50
becomes
120:

=LARGE($A$1:$H$15,INT(RAND()*120+1))

And if you don't want to have to worry about the cell count, use this
variation and just change both ranges each time you make a change in the
number of cells included...

=LARGE($A$1:$H$15,INT(RAND()*COUNTIF($A$1:$H$15,"<>""")+1))

Rick
 
Top