NORMSINV() is quite slow, so if you are simulating many normal random variables that method may end up being painfully slow, in which case may I recommend the following:
RAND() on the worksheet or Rnd in VBA code will return a uniformly distributed random variable on (0,1]
To simulate a normal r.v. sum N of these uniform r.v. and normalise the mean by subtracting N/2 (mean was N * 1/2, now will be 0), then normalise the variance by multiplying by SQRT(12/N) (standard deviation was N * 12, now will be 1) or use Sqr in VBA.
As N tends to infinity this will be normal, any finite N will be an approximation but by the central limit theorem it converes quickly.
e.g. in a cell using N=12:
=RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() - 6
e.g. in a cell using N=24:
=SQRT(0.5)
* (RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() + RAND() - 12)
e.g. in a VBA function using N=uniformCount:
Code:
Public Function NORMR(uniformCount)
Application.Volatile (True) 'This will allow recalculation via F9
Randomize 'This reseeds using the timer
Dim retVal As Double
retval = 0
For i = 1 To uniformCount
retVal = retVal + Rnd
Next i
retVal = retVal - (uniformCount / 2)
NORMR = Sqr(12 / uniformCount) * retVal
End Function