# Excel Functions Related to Counting & Probability

### Combinatorial Functions

FACT(n)

The factorial function $n!$.

COMBIN(n,k)

Combinations of $n$ things taken $k$ at a time, ${}_n C_k$.

PERMUT(n,k)

Permutations of $n$ things taken $k$ at a time, ${}_n P_k$.

MULTINOMIAL(k,m,n)

Permutations with $k,m,n,\ldots$ indistinguishable duplicates. Note, you can have more than just 3 arguments. As an example, the following counts the number of distinguishable rearrangements of AABBBBBCCCDD: $$\textrm{MULTINOMIAL}(2,5,3,2) = \frac{(2+5+3+2)!}{2! \cdot 5! \cdot 3! \cdot 2!} = 166320$$

### Rounding Functions

ROUND(x,n)

Round $x$ off to $n$ fractional digits. Examples:
ROUND(32.56,1) = 32.6
ROUND(32.56,0) = 33
ROUND(-34.6,0) = -35

ROUNDUP(x,n)

Round $x$ up to $n$ fractional digits. Examples:
ROUNDUP(32.56,1) = 32.6
ROUNDUP(32.41,1) = 32.5
ROUNDUP(-3.2,0) = -4

ROUNDDOWN(x,n)

Round $x$ down to $n$ fractional digits. Examples:
ROUNDDOWN(32.56,1) = 32.5
ROUNDDOWN(32.41,1) = 32.4

TRUNC(x,n)

Same as ROUNDDOWN(), but $n$ is optional and defaults to $0$. Examples:
TRUNC(2.8) = TRUNC(2.8,0) = 2
TRUNC(-2.8) = -2
TRUNC(-2.85,1) = -2.8

INT(x)

Rounds $x$ down to nearest integer. Examples:
INT(4.7) = 4
INT(-4.7) = -5

### Random Number Functions

RAND()

Generates a random number $x$ such that $0 \le x \lt 1$ in a manner consistent with a uniform distribution (every number is equally likely).

RANDBETWEEN(a,b)

Generates a random integer $n$ such that $a \le n \le b$.