ID EN
#Statistical

GAMMALN

Excel Functions

Calculate the natural logarithm of the gamma function.

Syntax

EXCEL
=GAMMALN(x)

Arguments

Parameter Description
x A positive real number for which you want to calculate the natural logarithm of the gamma function.

Return Value

A number representing the natural logarithm of the gamma function.

Details

The GAMMALN function returns the natural logarithm of the gamma function, ln(Γ(n)), for a given number. This is especially useful in statistical calculations, such as those involving probability distributions, where the gamma function appears in the denominator and direct computation could result in very large or very small numbers. For positive integers n, GAMMALN(n) is equivalent to LN((n-1)!). For example, the following formula calculates the natural logarithm of the gamma value for 5: The GAMMALN function takes a single argument as input like this: The argument x is the value for which you want to calculate the natural logarithm of the gamma function. Here are some basic examples showing both integer and non-integer inputs: In general, the GAMMALN function is equivalent to the natural

Examples

Example 1

For example, the following formula calculates the natural logarithm of the gamma value for 5:

EXCEL
=GAMMALN(5) // returns 3.17805383
Example #1 - Basic calculations

The GAMMALN function takes a single argument as input like this:

EXCEL
=GAMMALN(x)
Example #1 - Basic calculations

The argument x is the value for which you want to calculate the natural logarithm of the gamma function. Here are some basic examples showing both int

EXCEL
=GAMMALN(0.5) // returns 0.57236494...
=GAMMALN(2.0) // returns 0
=GAMMALN(2.5) // returns 0.28468287...
=GAMMALN(4.0) // returns 1.79175947...
Example #2 - Relationship to gamma and factorials

In general, the GAMMALN function is equivalent to the natural logarithm of the GAMMA function:

EXCEL
=GAMMALN(x) // returns LN(GAMMA(x))
Example #2 - Relationship to gamma and factorials

This relationship makes the GAMMALN function useful for calculations involving large factorials, as it avoids direct computation of large numbers. For

EXCEL
=GAMMA(172) // returns #NUM! error
Example #3 - Error conditions

The GAMMALN function returns #NUM! for zero and negative numbers, and #VALUE! for non-numeric inputs.

EXCEL
=GAMMALN(0) // returns #NUM! error
=GAMMALN(-1) // returns #NUM! error
=GAMMALN(-2.5) // returns #NUM! error
=GAMMALN("text") // returns #VALUE! error

See Also

GAMMALN.PRECISE GAMMA LN