GAMMALN Function

Returns the natural logarithm of the gamma function.

Category

Statistical

Available in

All versions, Microsoft 365

Returns

A number

Want to practice GAMMALN in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

GAMMALN returns ln(Γ(x)). Because it works with logarithms, it handles numbers whose gamma value (or factorial) would be far too large for Excel — then you subtract and add logs instead of dividing and multiplying.

GAMMALN.PRECISE gives the same result.

Syntax

=GAMMALN(x) Explain

Arguments

ArgumentRequired?What it does
xYesA number greater than 0.

Examples

Example 1 — Huge factorials without overflow

GAMMALN(100) is ln(99!), even though 99! has 156 digits.

B2fx=GAMMALN(10)
AB
1FormulaResult
2GAMMALN(10)12.8018
3EXP of it362880
4GAMMALN(100)359.1342
=GAMMALN(10) Explain

EXP(GAMMALN(10)) = 9! = 362,880.

Common mistakes

  • #NUM! x is 0 or negative.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.