NEGBINOMDIST

function NEGBINOMDIST(arg1: number = null, arg2: number = null, arg3: number = null): number

Description

Returns the negative binomial distribution, the probability that there will be the specified number of failures before the last success, with the specified probability of a success.

Parameters

arg1numberdefault: null

The number of failures.

arg2numberdefault: null

The threshold number of successes.

arg3numberdefault: null

The probability of a success; a number between 0 and 1.

Returns

number

Try It


const oWorksheet = Api.GetActiveSheet();

var valueArr = [6, 32, 0.7];

// Place the numbers in cells
for (var i = 0; i < valueArr.length; i++) {
 oWorksheet.GetRange("A" + (i + 1)).SetValue(valueArr[i]);
}

//method params
var numberF = oWorksheet.GetRange("A1").GetValue();
var numberS = oWorksheet.GetRange("A2").GetValue();
var probabilityS = oWorksheet.GetRange("A3").GetValue();

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.NEGBINOMDIST(numberF, numberS, probabilityS);

oWorksheet.GetRange("C1").SetValue(ans);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).