Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / September 2007

Tip: Looking for answers? Try searching our database.

Generating Random numbers.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tyler - 22 Sep 2007 21:08 GMT
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
joeu2004 - 22 Sep 2007 21:31 GMT
> 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())
Gord Dibben - 22 Sep 2007 21:48 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.