That depends on your constaints. Generally, to generate random
numbers with a uniform distribution, use the RAND() function in Excel
or the Rnd() function in VBA. If you want randoms integers between A
and B inclusive, again uniformly distributed, you can use the
following formula:
=A + int((B-A)*rand())
Alternativley, you can use RANDBETWEEN(), which is in the Analysis
ToolPak.
However, different techniques may be needed if you want something
other than a uniform distribution.
Moreover, some addition attention is needed if you want to avoid
duplicate random numbers.
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.