I need to generate a set of random numbers. I know there is a way to do this;
I just do not know how to find it. Please help me
> I need to generate a set of random numbers. I know there is a way
> to do this; I just do not know how to find it. Please help me
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.
joeu2004 - 22 Sep 2007 21:43 GMT
Errata....
On Sep 22, 1:31 pm, I wrote:
> If you want randoms integers between A and B inclusive,
> again uniformly distributed, you can use the following formula:
> =A + int((B-A)*rand())
I believe that should be either of the following formulas:
=A + round((B-A)*rand(), 0)
=A + int((B-A+1)*rand())
See help on RAND function.
Basic usage...............
In A1 enter = RAND() and copy down as far as you wish.
You may get duplicates using this method.
See John McGimpsey's site for Random numbers with no duplicates.
http://www.mcgimpsey.com/excel/udfs/randint.html
Gord Dibben MS Excel MVP
>I need to generate a set of random numbers. I know there is a way to do this;
>I just do not know how to find it. Please help me