View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Reid Robert Reid is offline
external usenet poster
 
Posts: 6
Default VBA module/function to generate random numbers with specified mean and SD

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.