WorksheetFunction.NegBinomDist Method

Returns the negative binomial distribution. NegBinomDist returns the probability that there will be number_f failures before the number_s-th success, when the constant probability of a success is probability_s. This function is similar to the binomial distribution, except that the number of successes is fixed, and the number of trials is variable. Like the binomial, trials are assumed to be independent.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function NegBinomDist ( _
    Arg1 As Double, _
    Arg2 As Double, _
    Arg3 As Double _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Double
Dim Arg2 As Double
Dim Arg3 As Double
Dim returnValue As Double

returnValue = instance.NegBinomDist(Arg1, _
    Arg2, Arg3)
double NegBinomDist(
    double Arg1,
    double Arg2,
    double Arg3
)

Parameters

  • Arg2
    Type: System.Double

    Number_s - the threshold number of successes.

  • Arg3
    Type: System.Double

    Probability_s - the probability of a success.

Return Value

Type: System.Double

Remarks

This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality. For more information about the new function, see the NegBinom_Dist(Double, Double, Double, Boolean) method.

For example, you need to find 10 people with excellent reflexes, and you know the probability that a candidate has these qualifications is 0.3. NegBinomDist calculates the probability that you will interview a certain number of unqualified candidates before finding all 10 qualified candidates.

Number_f and number_s are truncated to integers.

If any argument is nonnumeric, NegBinomDist returns the #VALUE! error value.

If probability_s < 0 or if probability > 1, NegBinomDist returns the #NUM! error value.

If number_f < 0 or number_s < 1, NegBinomDist returns the #NUM! error value.

The equation for the negative binomial distribution is:

Figure 1: Equation for the negative binomial distribution

Equation for the negative binomial distribution

where:

x is number_f, r is number_s, and p is probability_s.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace