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)| Argument | What it means | |
|---|---|---|
x | Required | A 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
| A | B | |
|---|---|---|
| 1 | x | Result |
| 2 | 5 | 3.1781 |
Result: 3.1781
Γ(5) = 24, and ln(24) = 3.17805383; shown to 4 decimal places.
2A fractional input
| A | B | |
|---|---|---|
| 1 | x | Result |
| 2 | 0.6 | 0.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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#NUM! | x is 0 or negative. | Use a positive input. |
#VALUE! | x is text. | Check the source cell. |
Tips
=EXP(GAMMALN.PRECISE(x))returnsGAMMA(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.
| Language | Function name |
|---|---|
| Dutch | GAMMA.LN.NAUWKEURIG |
| Finnish | GAMMALN.TARKKA |
| French | LNGAMMA.PRECIS |
| German | GAMMALN.GENAU |
| Hungarian | GAMMALN.PONTOS |
| Italian | LN.GAMMA.PRECISA |
| Norwegian (Bokmål) | GAMMALN.PRESIS |
| Polish | ROZKŁAD.LIN.GAMMA.DOKŁ |
| Portuguese (Brazil) | LNGAMA.PRECISO |
| Portuguese (Portugal) | LNGAMA.PRECISO |
| Russian | ГАММАНЛОГ.ТОЧН |
| Spanish | GAMMA.LN.EXACTO |
| Swedish | GAMMALN.EXAKT |
| Turkish | GAMALN.DUYARLI |