Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BTW - the generated numbers have to be = 0 (positive numbers)
"Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robert Reid -
=NORMINV(RAND(),mean,stdev) Caveat: Both NormInv and Rand may return numerically inaccurate results in pre-2003 Excel. - Mike www.mikemiddleton.com "Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the response Mike,
I'm not sure how I would use the excel function to generate 20 numbers that have a prespecified SD and mean using VBA. Can you clarify. "Mike Middleton" wrote in message ... Robert Reid - =NORMINV(RAND(),mean,stdev) Caveat: Both NormInv and Rand may return numerically inaccurate results in pre-2003 Excel. - Mike www.mikemiddleton.com "Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Robert Reid -
The worksheet functions =NORMINV(RAND(),mean,stdev) with appropriate numerical values for mean and stdev entered in worksheet cells will generate such numbers. If for some reason you must use VBA, either (1) write VBA code that enters the above into cells or (2) write VBA code with Application.WorksheetFunction.NormInv and VBA's RND function to generate the values and then write VBA code to insert the values into worksheet cells. - Mike "Robert Reid" wrote in message ... Thanks for the response Mike, I'm not sure how I would use the excel function to generate 20 numbers that have a prespecified SD and mean using VBA. Can you clarify. "Mike Middleton" wrote in message ... Robert Reid - =NORMINV(RAND(),mean,stdev) Caveat: Both NormInv and Rand may return numerically inaccurate results in pre-2003 Excel. - Mike www.mikemiddleton.com "Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() With Worksheets("Sheet1").Range("A1:A20") .formula = "=NORMINV(RAND(),150,10)" .Formula = .Value End With -- Regards, Tom Ogilvy "Robert Reid" wrote in message ... Thanks for the response Mike, I'm not sure how I would use the excel function to generate 20 numbers that have a prespecified SD and mean using VBA. Can you clarify. "Mike Middleton" wrote in message ... Robert Reid - =NORMINV(RAND(),mean,stdev) Caveat: Both NormInv and Rand may return numerically inaccurate results in pre-2003 Excel. - Mike www.mikemiddleton.com "Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to you all.
"Robert Reid" wrote in message ... Thanks for the response Mike, I'm not sure how I would use the excel function to generate 20 numbers that have a prespecified SD and mean using VBA. Can you clarify. "Mike Middleton" wrote in message ... Robert Reid - =NORMINV(RAND(),mean,stdev) Caveat: Both NormInv and Rand may return numerically inaccurate results in pre-2003 Excel. - Mike www.mikemiddleton.com "Robert Reid" wrote in message ... Hi all, As basis for a school assignment I need to generate 20 random numbers that have a prespecified mean and standard deviation ( I don't believe they have to be normally distrubted). Can anyone help? The output would preferably be to Worksheets("Sheet1").Range("A1:A20") though an array would also work. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Generate random numbers | Excel Discussion (Misc queries) | |||
Generate Random numbers from a pre-defined set | Excel Worksheet Functions | |||
generate a random number and use if function to generate new data | Excel Worksheet Functions | |||
Generate random numbers between two values and with a given mean | Excel Worksheet Functions | |||
generate random numbers | Excel Worksheet Functions |