Contact

GAMMALN.PRECISE in Excel: Log-Gamma Calculations and Domain Checks

Statistical Intermediate Microsoft Excel

Use the exact Excel GAMMALN.PRECISE name for positive-input log-gamma calculations, log likelihood components and factorial controls without assuming extra certified precision.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: GAMMALN.PRECISE(x) evaluates LN(gamma(x)) for a positive argument. Keep the period in the function name. The word PRECISE is part of Excel’s identifier, not a promise that a particular workbook result has a specified number of accurate digits.

Syntax and restrictions

=GAMMALN.PRECISE(x)

There is one required argument. The documented domain is x>0. Microsoft specifies #NUM! at zero or negative inputs and #VALUE! when x is nonnumeric. The logarithm uses base e.

GAMMALN and GAMMALN.PRECISE are distinct names in Excel. This guide does not merge their identities or assert that one is always numerically better. Use the exact function required by the workbook and confirm that the recipient’s installation recognizes it.

Example 1: recover an ordinary value only when needed

=GAMMALN.PRECISE(5)
=EXP(GAMMALN.PRECISE(5))

Expected values are approximately 3.178053830 and 24. Gamma(5)=4!, so this is a logarithm of 24, not a logarithm of 120. For LN(5!), use GAMMALN.PRECISE(6).

For input values 1, 2, 3 and 4 in A2:A5, filling down =GAMMALN.PRECISE(A2) gives expected values 0, 0, 0.693147181 and 1.791759469. These small anchors make the factorial offset easy to inspect.

Example 2: noninteger parameters

=GAMMALN.PRECISE(0.5)
=GAMMALN.PRECISE(1.5)

Expected results are 0.572364943 and -0.120782238. The first is LN(sqrt(pi)). The second is negative because gamma(1.5) is between zero and one.

A negative output is valid. A negative input is outside the documented domain. These two situations should not share the same error-handling rule.

Advanced application: a beta-normalization component

For positive parameters a and b, a commonly used log-normalization expression is:

=GAMMALN.PRECISE(2)+GAMMALN.PRECISE(3)-GAMMALN.PRECISE(5)

Expected value: -2.484906650. Taking EXP gives 0.083333333, or 1/12. The input values represent a=2, b=3 and a+b=5.

This is an independently derived mathematical example, not a call to an Excel beta-distribution function. If a and b are worksheet parameters, ensure that both are positive before forming their sum and applying the three functions. A successful numeric result alone does not validate the statistical model in which it is used.

Advanced application: a likelihood term

For a nonnegative integer event count k, a Poisson log-probability can be assembled as k×LN(lambda)−lambda−LN(k!). With k=3 and positive mean lambda=2:

=3*LN(2)-2-GAMMALN.PRECISE(4)
=EXP(3*LN(2)-2-GAMMALN.PRECISE(4))

Expected values are approximately -1.712317928 and 0.180447044. The GAMMALN.PRECISE input is k+1, which is 4.

This illustration assumes a Poisson model and a positive lambda. It does not fit lambda from data, establish model suitability or prescribe a business decision. For ordinary workbook probability calculations, a dedicated Poisson function is often easier to read. Log-domain components are useful when adding many log probabilities.

Verify recurrence with a tolerance

For x=2.5:

=GAMMALN.PRECISE(3.5)-GAMMALN.PRECISE(2.5)
=LN(2.5)

Both have expected value 0.916290732. The relation is a mathematical control, not a native precision benchmark. Differences at tiny floating-point scales should be judged against the actual application’s requirements.

Errors and practical checks

GAMMALN.PRECISE(0) and GAMMALN.PRECISE(-1) have documented #NUM! expectations. If the function is unrecognized, check the exact spelling and the installation’s supported function set. Do not remove the period or silently substitute a different function name.

Exponentiating a large log value may still produce an unrepresentable result, even though the log value itself is manageable. Near-canceling differences of large logarithms can also lose relative precision. This guide does not establish numeric boundary values, text-coercion rules, blank handling, or a last working release.

Availability and version history

  • Current documentation: the dedicated Microsoft reference lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2019 for Mac, Excel 2016.
  • Introduced: Microsoft’s alphabetical function catalog marks GAMMALN.PRECISE as introduced in Excel 2010. The exact first build and platform-specific introduction dates are not established here.
  • Last functioning version: unknown; a current help listing is not a last-working-build test.
  • Evidence checked: October 15, 2026. Official documentation was freshly retrieved; examples below were independently calculated. No native Excel, Mac or web-client execution was performed.

References and verification

Examples use English function names and comma separators. Expected numbers are rounded independent mathematical calculations; documented error expectations are labeled as such. They are not captured Excel output. All illustrative data and policies are fictional.