MULTINOMIAL function
PRO BASIC
The MULTINOMIAL function in Jspreadsheet Formulas Pro is a mathematical tool thatcalculates the multinomial coefficient, which is the factorial of the sum of given numbers divided by the product of their factorials. To put it simply, if you have a series of numbers, this function will calculate the factorial for each number (which is the product of all positive integers up to that number), and then multiply those results together. This function is particularly useful in statistical calculations and probability theory scenarios where you need to calculate combinations or permutations.
Documentation
Returns the multivariate factorial, which is the product of factorials of a series of numbers.
Category
Math and trigonometry
Syntax
MULTINOMIAL(number1, [number2],...)
| Parameter | Description | 
|---|---|
number1 | 
The first number. | 
numberN | 
The nth number. | 
Behavior
The MULTINOMIAL function calculates the multinomial of a set of numbers. This function takes a set of positive integer values as input and returns their multinomial.
- If any argument contains an error, the 
MULTINOMIALfunction will return that error. - If the arguments include decimal numbers, Jspreadsheet truncates them to their integer part before calculation.- The function handles decimal numbers by truncating them to integers.
 - If the argument includes negative numbers, the 
MULTINOMIALfunction returns a #NUM! error. 
Common Errors
| Error | Description | 
|---|---|
| #VALUE! | This error occurs if the provided argument is non-numeric. | 
| #NUM! | This error is shown when the provided argument is a negative number. | 
| #N/A | This error is displayed if there are no arguments provided to the function. | 
Best practices
- Always ensure that the provided values are positive integers to avoid any errors.
 - If you are using cell references as the function's arguments, make sure that these cells contain numeric values.
 - Be aware that the function treats decimal numbers as integers by truncating the decimal part.
 - Use the
 MULTINOMIALfunction to calculate multinomial coefficients in probability and statistics problems, such as multinomial expansions. Avoid using it for negative numbers as it would result in an error.
Usage
A few examples using the MULTINOMIAL function.
MULTINOMIAL(3, 4, 5) // returns 27720, because (3+4+5)! / (3! * 4! * 5!)  
MULTINOMIAL(2, 2, 1) // returns 30  
MULTINOMIAL(A2:A6) // calculates using the values in cells A2 through A6  
MULTINOMIAL(0, 0, 5) // returns 1, since only one nonzero factorial contributes  
Interactive Spreadsheet Demo
<html>
<script src="https://jspreadsheet.com/v11/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v11/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/formula-pro/dist/index.min.js"></script>
<div id="spreadsheet"></div>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('NWMyYTkwY2VlNmQ0ODliZWRmODNhNmVmNzE5ZGYwYWZiMjc2ZjBkNjFkYzhkMjk4ZDE5MDBlOWZlOWI3OGViOGE1MTA5ZjFlNTNhMDY2YzllMTQzZjViZDBhNmFhODdlMTQzYTlhODZjYzg0Y2E5NGQ0ZmMwMWVhMmQyZmMyZGUsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qVTJPVGM0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
  worksheets: [{
    data: [
    [
        "Lottery Balls",
        "Red",
        "Blue",
        "Green",
        "Multinomial"
    ],
    [
        "Draw 1",
        2,
        3,
        1,
        "=MULTINOMIAL(B2:D2)"
    ],
    [
        "Draw 2",
        4,
        2,
        3,
        "=MULTINOMIAL(B3:D3)"
    ],
    [
        "Draw 3",
        1,
        1,
        2,
        "=MULTINOMIAL(B4:D4)"
    ]
]
  }]
});
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/react";
import formula from "@jspreadsheet/formula-pro";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
// Set license
jspreadsheet.setLicense('NWMyYTkwY2VlNmQ0ODliZWRmODNhNmVmNzE5ZGYwYWZiMjc2ZjBkNjFkYzhkMjk4ZDE5MDBlOWZlOWI3OGViOGE1MTA5ZjFlNTNhMDY2YzllMTQzZjViZDBhNmFhODdlMTQzYTlhODZjYzg0Y2E5NGQ0ZmMwMWVhMmQyZmMyZGUsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qVTJPVGM0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
    // Spreadsheet array of worksheets
    const spreadsheet = useRef();
    // Worksheet data
    const data = [
    [
        "Lottery Balls",
        "Red",
        "Blue",
        "Green",
        "Multinomial"
    ],
    [
        "Draw 1",
        2,
        3,
        1,
        "=MULTINOMIAL(B2:D2)"
    ],
    [
        "Draw 2",
        4,
        2,
        3,
        "=MULTINOMIAL(B3:D3)"
    ],
    [
        "Draw 3",
        1,
        1,
        2,
        "=MULTINOMIAL(B4:D4)"
    ]
];
    // Render component
    return (
        <Spreadsheet ref={spreadsheet}>
            <Worksheet data={data} />
        </Spreadsheet>
    );
}
<template>
    <Spreadsheet ref="spreadsheet">
        <Worksheet :data="data" />
    </Spreadsheet>
</template>
<script>
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/vue";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
import formula from "@jspreadsheet/formula-pro";
// Set license
jspreadsheet.setLicense('NWMyYTkwY2VlNmQ0ODliZWRmODNhNmVmNzE5ZGYwYWZiMjc2ZjBkNjFkYzhkMjk4ZDE5MDBlOWZlOWI3OGViOGE1MTA5ZjFlNTNhMDY2YzllMTQzZjViZDBhNmFhODdlMTQzYTlhODZjYzg0Y2E5NGQ0ZmMwMWVhMmQyZmMyZGUsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qVTJPVGM0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
    components: {
        Spreadsheet,
        Worksheet,
    },
    data() {
        // Worksheet data
        const data = [
    [
        "Lottery Balls",
        "Red",
        "Blue",
        "Green",
        "Multinomial"
    ],
    [
        "Draw 1",
        2,
        3,
        1,
        "=MULTINOMIAL(B2:D2)"
    ],
    [
        "Draw 2",
        4,
        2,
        3,
        "=MULTINOMIAL(B3:D3)"
    ],
    [
        "Draw 3",
        1,
        1,
        2,
        "=MULTINOMIAL(B4:D4)"
    ]
]
        return {
            data
        };
    }
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import * as formula from "@jspreadsheet/formula-pro";
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('NWMyYTkwY2VlNmQ0ODliZWRmODNhNmVmNzE5ZGYwYWZiMjc2ZjBkNjFkYzhkMjk4ZDE5MDBlOWZlOWI3OGViOGE1MTA5ZjFlNTNhMDY2YzllMTQzZjViZDBhNmFhODdlMTQzYTlhODZjYzg0Y2E5NGQ0ZmMwMWVhMmQyZmMyZGUsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpZeU1qVTJPVGM0TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0ltTm9ZWEowY3lJc0ltWnZjbTF6SWl3aVptOXliWFZzWVNJc0luQmhjbk5sY2lJc0luSmxibVJsY2lJc0ltTnZiVzFsYm5Seklpd2lhVzF3YjNKMFpYSWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0lzSW5CeWFXNTBJaXdpYzJobFpYUnpJaXdpWTJ4cFpXNTBJaXdpYzJWeWRtVnlJaXdpYzJoaGNHVnpJaXdpWm05eWJXRjBJbDBzSW1SbGJXOGlPblJ5ZFdWOQ==');
// Set the extensions
jspreadsheet.setExtensions({ formula });
@Component({
    standalone: true,
    selector: "app-root",
    template: `<div #spreadsheet></div>`
})
export class AppComponent {
    @ViewChild("spreadsheet") spreadsheet: ElementRef;
    // Worksheets
    worksheets: jspreadsheet.worksheetInstance[];
    // Create a new data grid
    ngAfterViewInit() {
        // Create spreadsheet
        this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
            worksheets: [{
                data: [
    [
        "Lottery Balls",
        "Red",
        "Blue",
        "Green",
        "Multinomial"
    ],
    [
        "Draw 1",
        2,
        3,
        1,
        "=MULTINOMIAL(B2:D2)"
    ],
    [
        "Draw 2",
        4,
        2,
        3,
        "=MULTINOMIAL(B3:D3)"
    ],
    [
        "Draw 3",
        1,
        1,
        2,
        "=MULTINOMIAL(B4:D4)"
    ]
]
            }]
        });
    }
}