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
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
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
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
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
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
How do you paste the formula in 100 cells at one time?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks