Documentation/Calc Functions/COMBINA

    From The Document Foundation Wiki
    Other languages:


    Function name:

    COMBINA

    Category:

    Mathematical

    Summary:

    Calculates the number of combinations with repetition when choosing a subset of k objects from a pool of n objects.

    Syntax:

    COMBINA(Number1; Number2)

    Returns:

    Returns a non-negative integer that is the number of combinations with repetition for the given arguments.

    Arguments:

    Number1 is a non-negative integer, or a reference to a cell containing that number, that is the number of objects in the pool.

    Number2 is a non-negative integer, or a reference to a cell containing that number, that is the number of objects to be chosen from the pool.

    • If either Number1 or Number2 is non-numeric, then COMBINA reports a #VALUE! error.
    • If either Number1 or Number2 is a non-integer value, then COMBINA converts it to an integer by taking its floor value.
    • If either Number1 or Number2 is less than 0, then COMBINA reports an invalid argument error (Err:502).
    • If Number1 < Number2, then COMBINA reports an invalid argument error (Err:502).

    Additional details:

    • For example, if there are 3 items A, B and C in a set, you can choose 2 items in 6 different ways, namely AA, AB, AC, BB, BC and CC; you can choose 3 items in 10 different ways, namely AAA, AAB, AAC, ABB, ABC, ACC, BBB, BBC, BCC, CCC.
    • The formula specifying the number of possible combinations with repetition if selecting k items from a collection of n items (when order does not matter, unlike permutations), with kn, is as follows:
      [math]\displaystyle{ \text{COMBINA}(n, k)~=~\frac{(k+n-1)!}{k!(n-1)!} }[/math]
    • For more information, visit Wikipedia's Combination page.

    Examples:

    Formula Description Returns
    =COMBINA(3; 2) From a group of 3 items, 2 can be chosen with repetitions in 6 ways. 6
    =COMBINA(D1; D2)

    where cells D1 and D2 both contain the number 3.

    From a group of 3 items, 3 can be chosen with repetitions in 10 ways. 10
    =COMBINA(7.6; 3.3)

    Truncate both arguments, to 7 and 3 respectively. From a group of 7 items, 3 can be chosen with repetitions in 84 ways.

    84

    Related LibreOffice functions:

    COMBIN

    PERMUT

    PERMUTATIONA

    ODF standard:

    Section 6.16.17, part 2

    Related (or similar) Excel functions:

    COMBINA since v.2013.