Statistical function

GAMMALN.PRECISE function

Returns the natural logarithm of the gamma function; the Excel 2010+ version of GAMMALN with the same result.

Available in Excel 2010 and later, Microsoft 365, Excel for the web, Excel for Mac 2011 and later

Excel 2010 and laterWorks in Google Sheets

Syntax

GAMMALN.PRECISE(x)
ArgumentWhat it means
xRequiredA positive number.

Returns: The value ln(Γ(x)).

How GAMMALN.PRECISE works

GAMMALN.PRECISE was added in Excel 2010 when Microsoft reworked its statistical functions for better accuracy. It calculates the same thing as GAMMALN, the natural log of the gamma function, and in current versions of Excel the two return identical values. The "PRECISE" name was kept so that formulas written with it say clearly that they rely on the improved algorithm.

Use it wherever you need log-factorials: building probabilities by hand, comparing very large counts, or computing the logarithm of a beta function as GAMMALN.PRECISE(a)+GAMMALN.PRECISE(b)-GAMMALN.PRECISE(a+b). If your workbook must open in Excel 2007, use GAMMALN instead.

Examples

1Log of 4 factorial

B2fx=GAMMALN.PRECISE(A2)
AB
1xResult
253.1781

Result: 3.1781

Γ(5) = 24, and ln(24) = 3.17805383; shown to 4 decimal places.

2A fractional input

B2fx=GAMMALN.PRECISE(A2)
AB
1xResult
20.60.3982

Result: 0.3982

Γ(0.6) is about 1.489192, so its natural log is 0.398234 (shown to 4 decimals). The result is positive because Γ is above 1 for inputs between 0 and 1.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 13 KB

Common errors and how to fix them

ErrorWhy it happensFix
#NUM!x is 0 or negative.Use a positive input.
#VALUE!x is text.Check the source cell.

Tips

  • =EXP(GAMMALN.PRECISE(x)) returns GAMMA(x) for positive x.
  • Choose GAMMALN for files shared with Excel 2007 users; otherwise either name is fine.

Google Sheets

GAMMALN.PRECISE also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

GAMMALN.PRECISE in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DutchGAMMA.LN.NAUWKEURIG
FinnishGAMMALN.TARKKA
FrenchLNGAMMA.PRECIS
GermanGAMMALN.GENAU
HungarianGAMMALN.PONTOS
ItalianLN.GAMMA.PRECISA
Norwegian (Bokmål)GAMMALN.PRESIS
PolishROZKŁAD.LIN.GAMMA.DOKŁ
Portuguese (Brazil)LNGAMA.PRECISO
Portuguese (Portugal)LNGAMA.PRECISO
RussianГАММАНЛОГ.ТОЧН
SpanishGAMMA.LN.EXACTO
SwedishGAMMALN.EXAKT
TurkishGAMALN.DUYARLI