Both formulas are correct, but the range of application is a bit off.
The second formula is an asymptotic expansion. That means that if you
use enough terms, it will fail to converge for any finite z. You can
stop the sum when the next term is larger in magnitude than the previous
one, but you would need to use a larger change point (z2) before using
the second formula.
That asymptotic expansion can be converted to to a continued fraction,
Abramowitz & Stegun equation 7.1.14
http://jove.prohosting.com/~skripty/page_298.htm
that is absolutely convergent for all positive z. You would switch
between your first formula and the continued fraction around z=2.
Jerry
Rijan wrote:
Dear Jerry and Dana,
Thanks for your replies. But still I could not calculate NORMDIST without
using Excel. Would you please check the following equations which I have used
for ERF?
For z less than 1, ERF = 2/SQRT (pi) * e^(-z^2) * z (1+ (2z^2)/3 +
((2z^2)^2)/15 + €¦
For z greater than 1, ERF = 1- (e^(-z^2))/(SQRT(pi)) * (1/z - 1/(2z^3) +
3/(4z^5) -€¦.)