Excel functions / Math

GAMMALN function

The natural logarithm of the gamma function. It stays small where GAMMA itself would overflow.

Syntax

=GAMMALN(x)

Arguments

When to use it

GAMMALN gives the natural logarithm of GAMMA. It stays small where GAMMA would overflow, so ratios of huge factorials can be worked out with EXP of a difference.

Examples

  1. GAMMALN of 4

    ABC
    1x
    241.7918

    In C2: =GAMMALN(A2) → 1.7918

    Try this example

  2. 200 choose 100, too large for FACT

    ABC
    1n
    22009.05E+58

    In C2: =EXP(GAMMALN(A2+1)-2*GAMMALN(A2/2+1)) → 9.05E+58

    Try this example

Common mistakes

GAMMALN in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Also written as GAMMALN.PRECISE.

Try GAMMALN in the playground

Related functions