WorksheetFunction.Permut Method

Returns the number of permutations for a given number of objects that can be selected from number objects. A permutation is any set or subset of objects or events where internal order is significant. Permutations are different from combinations, for which the internal order is not significant. Use this function for lottery-style probability calculations.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Permut ( _
    Arg1 As Double, _
    Arg2 As Double _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Double
Dim Arg2 As Double
Dim returnValue As Double

returnValue = instance.Permut(Arg1, Arg2)
double Permut(
    double Arg1,
    double Arg2
)

Parameters

  • Arg1
    Type: System.Double

    Number - an integer that describes the number of objects.

  • Arg2
    Type: System.Double

    Number_chosen - an integer that describes the number of objects in each permutation.

Return Value

Type: System.Double

Remarks

Both arguments are truncated to integers.

If number or number_chosen is nonnumeric, Permut returns the #VALUE! error value.

If number ≤ 0 or if number_chosen < 0, Permut returns the #NUM! error value.

If number < number_chosen, Permut returns the #NUM! error value.

The equation for the number of permutations is:

Figure 1: Equation for the number of permutations

Equation for the number of permutations

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace