Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Help picking a random number from a given distribution

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Help picking a random number from a given distribution

If you use the function =RAND() it will generate a random number between 1
and 0. If you want it to be between 1 and 100 use =RAND()*100.

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 837
Default Help picking a random number from a given distribution

Theoretically, =NORMSINV(RAND()) would be a normal random number. In
practice, prior to Excel 2003 NORMSINV() was too inaccurate for for this to
be acceptable even for non-stringent applications. Alternately you could use
Ian Smith's inv_normal() function instead of the native Excel function
NORMSINV()
http://members.aol.com/iandjmsmith/Examples.xls

Another approach would be to use the Box-Muller method
=SQRT(-2*LN(RAND()))*COS(2*PI()*RAND())
or
=SQRT(-2*LN(RAND()))*SIN(2*PI()*RAND())

Jerry

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Help picking a random number from a given distribution

That will draw a random number from a uniform distribution. I'm looking for
one from a normal (bell shaped) or other distribution. I assume I'll need to
input a mean and standard deviation as well as specify the distribution, but
I'm having some difficulty determining if Excel can do it.

McGinty

"Office Helper" wrote:

If you use the function =RAND() it will generate a random number between 1
and 0. If you want it to be between 1 and 100 use =RAND()*100.

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Help picking a random number from a given distribution

Thanks, that's helpful. I'm using Excel 2003 so I'll try and keep it simple
and stay within their native functions. I'm still trying to incorporate
range however.

What I'm doing is building a model that will allow the user to input the
minimum and maximum possible values (between 0 and 1) and then have Excel
pull a random number from a normal or other distribution. Your suggestion of
=NORMSINV(RAND()) got me halfway there but I'm trying to figure out a way to
incorporate the range the user inputs. It could also be that I need to
assume some mean and standard deviation. =NORMSINV(RAND()) uses 0 and 1
respectively.

Any ideas or places to look?

Thanks

McGinty


"Jerry W. Lewis" wrote:

Theoretically, =NORMSINV(RAND()) would be a normal random number. In
practice, prior to Excel 2003 NORMSINV() was too inaccurate for for this to
be acceptable even for non-stringent applications. Alternately you could use
Ian Smith's inv_normal() function instead of the native Excel function
NORMSINV()
http://members.aol.com/iandjmsmith/Examples.xls

Another approach would be to use the Box-Muller method
=SQRT(-2*LN(RAND()))*COS(2*PI()*RAND())
or
=SQRT(-2*LN(RAND()))*SIN(2*PI()*RAND())

Jerry

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 837
Default Help picking a random number from a given distribution

=NORMSINV(RAND())*SD+mean
or equuivalently
=NORMINV(RAND(),mean,SD)

Similarly, you can theoretically use the inverse of any other distribution,
but all Excel inverses other than normal are inadequate to the task, so I
would recommend using Ian Smith's VBA functions.

Jerry

"McGinty" wrote:

Thanks, that's helpful. I'm using Excel 2003 so I'll try and keep it simple
and stay within their native functions. I'm still trying to incorporate
range however.

What I'm doing is building a model that will allow the user to input the
minimum and maximum possible values (between 0 and 1) and then have Excel
pull a random number from a normal or other distribution. Your suggestion of
=NORMSINV(RAND()) got me halfway there but I'm trying to figure out a way to
incorporate the range the user inputs. It could also be that I need to
assume some mean and standard deviation. =NORMSINV(RAND()) uses 0 and 1
respectively.

Any ideas or places to look?

Thanks

McGinty


"Jerry W. Lewis" wrote:

Theoretically, =NORMSINV(RAND()) would be a normal random number. In
practice, prior to Excel 2003 NORMSINV() was too inaccurate for for this to
be acceptable even for non-stringent applications. Alternately you could use
Ian Smith's inv_normal() function instead of the native Excel function
NORMSINV()
http://members.aol.com/iandjmsmith/Examples.xls

Another approach would be to use the Box-Muller method
=SQRT(-2*LN(RAND()))*COS(2*PI()*RAND())
or
=SQRT(-2*LN(RAND()))*SIN(2*PI()*RAND())

Jerry

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Help picking a random number from a given distribution

Thanks, that's very helpful and I'll give it a shot.

McGinty

"Jerry W. Lewis" wrote:

=NORMSINV(RAND())*SD+mean
or equuivalently
=NORMINV(RAND(),mean,SD)

Similarly, you can theoretically use the inverse of any other distribution,
but all Excel inverses other than normal are inadequate to the task, so I
would recommend using Ian Smith's VBA functions.

Jerry

"McGinty" wrote:

Thanks, that's helpful. I'm using Excel 2003 so I'll try and keep it simple
and stay within their native functions. I'm still trying to incorporate
range however.

What I'm doing is building a model that will allow the user to input the
minimum and maximum possible values (between 0 and 1) and then have Excel
pull a random number from a normal or other distribution. Your suggestion of
=NORMSINV(RAND()) got me halfway there but I'm trying to figure out a way to
incorporate the range the user inputs. It could also be that I need to
assume some mean and standard deviation. =NORMSINV(RAND()) uses 0 and 1
respectively.

Any ideas or places to look?

Thanks

McGinty


"Jerry W. Lewis" wrote:

Theoretically, =NORMSINV(RAND()) would be a normal random number. In
practice, prior to Excel 2003 NORMSINV() was too inaccurate for for this to
be acceptable even for non-stringent applications. Alternately you could use
Ian Smith's inv_normal() function instead of the native Excel function
NORMSINV()
http://members.aol.com/iandjmsmith/Examples.xls

Another approach would be to use the Box-Muller method
=SQRT(-2*LN(RAND()))*COS(2*PI()*RAND())
or
=SQRT(-2*LN(RAND()))*SIN(2*PI()*RAND())

Jerry

"McGinty" wrote:

Is there a way for me to have Excel select a random number from a given,
e.g., normal distribution? Also can I put a range on the distribution?

Thanks in advance

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
random number Hookster23 Excel Discussion (Misc queries) 2 April 28th 06 06:20 AM
Random Number response Union70 Excel Worksheet Functions 1 April 27th 06 06:27 PM
Generating (in a random order)each number once from a given number Neil Goldwasser Excel Worksheet Functions 2 December 2nd 05 11:27 PM
Random Number Questions Greegan Excel Worksheet Functions 1 January 5th 05 02:00 AM


All times are GMT +1. The time now is 12:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"