RANDBETWEEN

G

Gaurav

Hi All,

If I use RANDBETWEEN function to generate random samples, how do I make sure
that units are not repeate?

For example-

I have 1000 units and I have to generate 30 samples. I will use
RANDBETWEEN(1,30) in 30 cells. How do I make sure that the numbers are not
repeated and all the samples are unique?

Thanks in advance for any help.
 
R

RagDyer

One way to generate random numbers without replacement:

Enter the Rand function in an out-of-the-way location of your sheet,

=Rand()

And copy down,
say Z1 to Z1000.

Then enter this formula anywhere:

=INDEX(ROW($A$1:$A$1000),RANK(Z1,$Z$1:$Z$1000))

And copy down as many rows as the amount of numbers you need.

Each time you hit <F9>, you'll get a new random list.
 

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