Pick data from an array

G

Guest

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?
 
G

Guest

one way:

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

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

HTH
 
G

Guest

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
 

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