![]() |
How do you generate random numbers in a normal distribution?
Hi,
How do you generate 100 random numbers with a normal distribution between 0 and 90? And when this is done how do you stop the random numbers changing each time you do something else? Thanks |
How do you generate random numbers in a normal distribution?
Option Explicit
Sub genRan() Dim index As Long For index = 1 To 100 Cells(index, 1).Value = Rnd() * 90 Next End Sub "Ladee_bird" wrote: Hi, How do you generate 100 random numbers with a normal distribution between 0 and 90? And when this is done how do you stop the random numbers changing each time you do something else? Thanks |
How do you generate random numbers in a normal distribution?
Thanks,
I'm a complete novice at this. So you just enter this into the equation bar? Thanks "Patrick Molloy" wrote: Option Explicit Sub genRan() Dim index As Long For index = 1 To 100 Cells(index, 1).Value = Rnd() * 90 Next End Sub "Ladee_bird" wrote: Hi, How do you generate 100 random numbers with a normal distribution between 0 and 90? And when this is done how do you stop the random numbers changing each time you do something else? Thanks |
How do you generate random numbers in a normal distribution?
This will not generate a normal distribution, unfortunately. Rnd() has an
equal probability for every number in the range, so its distribution is flat, not normal. "Patrick Molloy" wrote: Option Explicit Sub genRan() Dim index As Long For index = 1 To 100 Cells(index, 1).Value = Rnd() * 90 Next End Sub "Ladee_bird" wrote: Hi, How do you generate 100 random numbers with a normal distribution between 0 and 90? And when this is done how do you stop the random numbers changing each time you do something else? Thanks |
How do you generate random numbers in a normal distribution?
Ladee_bird -
How do you generate 100 random numbers with a normal distribution between 0 and 90? < The normal distribution is determined by its mean and standard deviation, not by a range "between 0 and 90." Theoretically, the possible values from a normal distribution range from minus infinity to plus infinity. But most values are within three or four standard deviations from the mean. One way to get normal distribution values with mean 45 and standard deviation 5 is to use the worksheet functions =NORMINV(RAND(),45,5). Copy to 100 cells for 100 such random numbers. And when this is done how do you stop the random numbers changing each time you do something else? < Edit Copy. Edit Paste Special Values. - Mike www.mikemiddleton.com |
All times are GMT +1. The time now is 01:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com