Related Functions:

The GAMMALN function returns the natural logarithm of the gamma function, \Gamma(x).

Syntax

=GAMMALN(x)

Arguments

Argument Description
x The value for which you want to calculate GAMMALN

Examples

  A B C
1 Formula Result Notes
2 =GAMMALN(4) 1.7917595 Natural logarithm of the gamma function at 4
3 =GAMMALN(3.5) 2.200974 Natural logarithm of the gamma function at 3.5
4 =GAMMALN(1.5) -0.12078 Natural logarithm of the gamma function at 1.5

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if the supplied value of x is not recognised as a numeric value
#NUM! Occurs if the supplied value of x is ≤ 0

GAMMALN is calculated as:    

    \[    \begin{aligned}\text{GAMMALN} &= \ln (\Gamma(x)) \\\\\text{where: } f(x) &= \left\{ \begin{aligned}0 & \ \ \text{if }  x < 0  \\x & \ \ \text{if }  x \leq x \leq 1 \\1 & \ \ \text{if }  x > 1     \end{aligned} \end{aligned}    \]