跳到主要内容

PERMUT

返回从总对象中选择给定数量对象的排列数。

语法

expression.PERMUT(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number对象总数。
arg2必需ApiRange | ApiName | number每个排列中的对象数。

返回值

number

示例

计算电子表格中排列一组对象的方式数。

// How do I find the number of arrangements for selected items in a spreadsheet?

// Determine the count of unique permutations from a pool of distinct objects in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.PERMUT(32, 2));