Practice free

GAMMALN function

GAMMALN returns the natural logarithm of the gamma function. Working with logs avoids overflow for very large factorial-like values, and GAMMALN(n+1) is the log of n factorial.

Example

Read it as a sentence: find the natural log of the gamma function for 5, which gives 3.17805383.

Practice this in the app

Syntax

GAMMALN(x)

x (required)
Positive number.

Returns: The natural logarithm of the gamma function at x.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=GAMMALN(5) 3.17805383 Working example
=GAMMALN("5") 3.17805383 Text-number in first arg
=GAMMALN({5,5}) 3.17805383 Array in first arg (lifts, spills)
=GAMMALN(0.5) 0.572364943 Fraction
=GAMMALN("abc") #VALUE! Non-numeric text in first arg
=GAMMALN(NA()) #N/A Error in first arg
=GAMMALN(0) #NUM! Zero
=GAMMALN(-1) #NUM! Negative

Watch out for

  • x must be above zero.
  • GAMMALN(n+1) is the log of n factorial.

Where it works

Excel
GAMMALN is in every version of Excel from 2007 on.
Google Sheets
Same name, same behaviour for everyday use.

Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .