Documentation/Calc Functions/MULTINOMIAL

Function name:
MULTINOMIAL

Category:
Mathematical

Summary:
Calculates a multinomial coefficient for the given set of positive integers. Computes the factorial of the sum of those numbers and divides by the product of their individual factorials.

Syntax:
MULTINOMIAL(Number 1 [; Number 2 [; … [; Number 255]]])

Returns:
Returns a positive integer that is the multinomial coefficient for the given data.

Arguments:
Number 1, Number 2, …, Number 255 give the set of values for which the multinomial coefficient is to be calculated. At least one value must be provided.

Each argument may take one of the following forms:


 * A positive integer, or an expression that evaluates to a positive integer.
 * A reference to a single cell containing a positive integer.
 * A simple reference to a cell range containing positive integers (for example, A1:B9).
 * The name of a named range, comprising cells containing positive integers.
 * The name of a database range, comprising cells containing positive integers.
 * An inline array of positive integers (for example, {1, 2, 3, 4}).

Note that although MULTINOMIAL can accept up to 255 arguments, each argument could specify a range of cells. This means that the number of positive integers processed could be many more than 255. Beware however that MULTINOMIAL can return very large values from relatively small argument values – for example, the formula  returns the value 8413788240.

The following conditions (including errors) may be encountered:
 * If any argument is a string in quotation marks, or a reference to a single cell that contains a string rather than a positive integer, then MULTINOMIAL reports an error. This will be either a #VALUE! error or an invalid argument error (Err:502), depending on the values of other arguments.
 * Text and empty cells within a data range are ignored.
 * If any value is less than or equal to -1, then MULTINOMIAL reports an invalid argument error (Err:502). Values lying in the range -1 < x < 0 are rounded up to 0.0.
 * If any positive value is not an integer, that value is truncated to its floor value.
 * If after any truncation all supplied values are equal to 0, then MULTINOMIAL returns the value 1.

Additional details:

 * MULTINOMIAL ignores any text or empty cells within a data range. If you suspect wrong results, look for text within the supplied data range(s). To highlight text content within a data range, use Calc's feature.

$$ \text{ MULTINOMIAL }(N_1, N_2, ..., N_k)~=~\frac{(N_1+N_2+ ... +N_k)!}{N_1! \times N_2!\times ... \times N_k!}$$
 * For the set of k values N1…Nk, MULTINOMIAL implements the following formula:


 * For more general information about multinomials, visit Wikipedia's Multinomial theorem page.

Related LibreOffice functions:
FACT

ODF standard:
Section 6.16.43, part 2

Equivalent Excel functions:
MULTINOMIAL