Generate random number from a list

G

Guest

I have a list in cell A2:A300. There are not just integer values. Is there a
way to generate random values from that list even though some of the number
have decimals?
 
G

Guest

Tools -> Add-ins ... Select Analysis tool pack.

Enter this in the cell for your random values.

=INDIRECT("A"&RANDBETWEEN(2,300))

Keep in mind that when you recalculate the cell, it will change.
 
H

Harlan Grove

Barb Reinhardt wrote...
Tools -> Add-ins ... Select Analysis tool pack.

Enter this in the cell for your random values.

=INDIRECT("A"&RANDBETWEEN(2,300))
....

Unnecessary. Could be achieved using

=INDEX($A$2:$A$300,2+INT(299*RAND()))
 
H

Harlan Grove

Not
=INDEX($A$2:$A$300,1+INT(300*RAND()))
?

Now we've both made mistakes. Your 2nd argument would return 300 when
RAND() > 299/300, but then your INDEX call would return #REF!. Mine
would error when RAND() > 298/299, a bit more frequent, and it'd never
return the value in cell A2. It should be

=INDEX($A$2:$A$300,1+INT(299*RAND()))

or

=INDEX($A$1:$A$300,2+INT(299*RAND()))
 

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