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
- arg1
number
null The number of failures.
- arg2
number
null The threshold number of successes.
- arg3
number
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);