Random Numbers


Posted by Eric on October 31, 2001 2:47 PM

OK, this is a tough one, and I think it may require
visual basic (eek). Is there a way I can make Excel
generate a random number (example: I want a random
number from 1 to 10?).

Does this require visual basic? And if it does, is
anyone willing to talk me though a few simple
formulas?

Eric

Posted by Aladin Akyurek on October 31, 2001 3:21 PM


In A1 enter: =RAND() [ copy down till A10 ]

In B1 enter: =RANK(A1,$A1:$A$10)

Aladin

=========

Posted by Aladin Akyurek on October 31, 2001 3:21 PM


In A1 enter: =RAND() [ copy down till A10 ]

In B1 enter: =RANK(A1,$A1:$A$10)

Aladin

=========

Posted by Mark W. on November 01, 2001 9:47 AM

A random selection (with replacement)...

...of values between 1 and 10 inclusive can be
accomplished using =RANDBETWEEN(1,10). This
function is only available once the Analysis
ToolPak Addin has been loaded.

Posted by Mark W. on November 01, 2001 10:02 AM

If you'd prefer not to rely on the Analysis ToolPak...

=ROUND((RAND()*(10-1)+1),0) can also be used for
your random sample (without replacement).



Posted by Mark W. on November 01, 2001 10:04 AM

Oops! Meant to say "with replacement"...

=ROUND((RAND()*(10-1)+1),0) can also be used for
your random sample (with replacement).