PERMUTATIONA
function PERMUTATIONA(arg1: number = null, arg2: number = null): number
Description
Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.
Parameters
- arg1
number
null The total number of objects.
- arg2
number
null The number of objects in each permutation.
Returns
number
Try It
const oWorksheet = Api.GetActiveSheet();
//method params
var number = 32;
var number_chosen = 2;
oWorksheet.GetRange("A1").SetValue(number);
oWorksheet.GetRange("B1").SetValue(number_chosen);
var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.PERMUTATIONA(number, number_chosen);
oWorksheet.GetRange("C1").SetValue(ans);