The equation is the normal distribution curve.
Below my routine:
'Normal distribution integral
'BeginValue and EndValue are the interval values
'Mu = mean value
'Sigma = standard deviation
'Delta = calculation interval
Private Sub CalcGaussIntegral(BeginValue As Double, EndValue As Double, Mu As Double, Sigma As Double, Delta As Double) As Double
Private i, Integral, y0, y1 As Double
Private Denominator As Double
Delta = 0.1
Denominator = Sqrt(2 * cPI)
y0 = Power(cE, -(BeginValue - Mu) * (BeginValue - Mu) / 2 / Sigma / Sigma) / Sigma / Denominator
For i = BeginValue + Delta To EndValue Step Delta
y1 = Power(cE, -(i - Mu) * (i - Mu) / 2 / Sigma / Sigma) / Sigma / Denominator
Integral = Integral + (y0 + y1) / 2 * Delta
y0 = y1
Next
Return Integral
End Sub
The routine uses the trapeze integration formula.
With
CalcGaussIntegral(-5, 5, 0, 1, 0.001) you get 1, 100%
CalcGaussIntegral(-5, 0, 0, 1, 0.001) you get 0.5, 50%
CalcGaussIntegral(-1.96, 1.96, 0, 1, 0.001) you get 0.95, 95%
Maybe the calculation of the interval of confidence might be of interest for you.
Sorry, I am not as fast as Erel.
EDIT:
And the shape of the normal distribution curve and its integral drawn with xGraph.
Example corresponding to these parameters: CalcGaussIntegral(-5, 5, 0, 1, 0.001)