跳到主要内容

COMBINA

Returns the number of combinations with repetitions for a given number of items.

Syntax

expression.COMBINA(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe total number of items, a numeric value greater than or equal to 0.
arg2RequiredApiRange | ApiName | numberThe number of items in each combination, a numeric value greater than or equal to 0 but less than the total number of items.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.COMBINA(7, 2));