Hi everybody, I'm new here and new to VBA for excels, and I've found this website very helpful and people like you are very kind!

I'm learning about probability simulations. I konw in vba, rnd() is the uniformly distributed random number generator.And I've leant some other distribution random number generators, like triangular, exponential,or some discreted distributions. Anyway, the key to these methods is, using the Inverse Transform Method, which generate random numbers from any probability distribution given its cumulative distribution functions(cdf).
The inverse transform method works as follows:
1. generate a random number from the standard uniform distribution, u.
2. compute the value x such that F(x) = u. That is, solve for x so that x=F^(-1) (u).
3. x is random number drawn from the distribution f.

Now, I was wondering how to write the vba code for normal distribution(or standard normal distribution, which would be a little easier), I mean not just use this excel function: = normsinv(rand()), how to simulate it in vba code ?

And there's some restrictions : only use one rnd() to generate each z-score, which means you can't use the central limit theorem like this:

function random_snorm() as double
random_snorm = rnd() + rnd() + rnd()+rnd() + rnd() + rnd()+rnd() + _
rnd() + rnd()+rnd() + rnd() + rnd()-6
End function

Could anybody help me out here?