Wauvel

Excel like a finance pro.

← The library

Statistical function

GAMMALN

Returns the natural logarithm of the gamma function.

Rarely usedDifficulty 1500 · AdvancedUsage rank #398 of 520
Practice · 2 questions →

When to use it

The natural logarithm of the gamma function. Lets you work with factorials far too large to store directly.

The shape of it

Syntax
=GAMMALN(x)

Worked examples

  • Small value

    =GAMMALN(5) 3.17805383

    LN(24).

  • One

    =GAMMALN(1) 0

    GAMMA(1) is 1.

  • Huge factorial

    =EXP(GAMMALN(171)) 7.26E+306

    170 factorial, right at the edge of what a double can hold.

Worth knowing

  • LN(n!) = GAMMALN(n+1).
  • Log-binomial coefficients: GAMMALN(n+1)-GAMMALN(k+1)-GAMMALN(n-k+1).
  • GAMMALN.PRECISE is the same to more decimal places.

Where it goes wrong

  • #NUM! for 0 or negative input.
  • Exponentiating the result overflows above 171.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.