The Excel Gammaln function returns the natural logarithm of the Gamma Function, Γ(n).
The GAMMALN function syntax has the following arguments:
- X: Required. The value for which you want to calculate GAMMALN.
Example: Let’s look at some Excel GAMMALN function examples and explore how to use the GAMMALN function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following GAMMALN examples would return:
- If x is nonnumeric, GAMMALN returns the #VALUE! error value.
- If x ≤ 0, GAMMALN returns the #NUM! error value.
- The number e raised to the GAMMALN(i) power, where i is an integer, returns the same result as (i – 1)!.
GAMMALN is calculated as follows: