← All functions

GAMMALN.PRECISE

Quirk found

Category: Statistical · Last tested 2026-09-01

Real compatibility results for the GAMMALN.PRECISE function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.

Support matrix

EngineDocumentedLive-testedVerdict
Excel (desktop)Yes No — documented only n/a
Excel for the web— Yes (recalc, 2026-09-01) Supported, behaves as documented
Google SheetsYes Yes (Drive import, 2026-08-31) Supported, behaves as documented
LibreOffice CalcYes Yes (25.8.7.3, 2026-08-31) Quirk found

LibreOffice version history

We executed the same test cases under each LibreOffice release to show exactly when GAMMALN.PRECISE’s support changed — not documentation claims, real results.

LibreOffice versionVerdictTested
24.2.0.3 Quirk found 2026-08-31
24.8.7.2 Quirk found 2026-08-31
25.2.0.3 Quirk found 2026-08-31
25.8.7.3 Quirk found 2026-08-31

Why isn't GAMMALN.PRECISE working in LibreOffice?

GAMMALN.PRECISE exists in LibreOffice 25.8.7.3, but it is not a drop-in match for Excel — our executed tests found real behavioral differences (detailed in the test results on this page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage against the failing cases above before assuming your data is wrong.

Discovered quirks

Executed test cases

Excel for the web (executed 2026-09-01 via OneDrive recalculation)

These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.

FormulaDescriptionResultExpectedVerdict
=ROUND(GAMMALN.PRECISE(4),12) Microsoft's documented worked example: the natural logarithm of the gamma function at 4 1.791759469228 1.791759469228
Provenance

Microsoft publishes '=GAMMALN.PRECISE(4)' with the result 1.7917595. Derived independently two ways that agree to every digit mpmath prints at 50 places: mpmath's loggamma(4) = 1.7917594692280550008, and -- using the page's own stated identity that "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!" -- ln(3!) = ln(6) = 1.7917594692280550008. Rounds to exactly the published 1.7917595 at the 7 dp the page prints; asserted at 12 dp because that is still comfortably inside double precision.

Matched
=ROUND(EXP(GAMMALN.PRECISE(6)),9) The page's own identity: e raised to GAMMALN(i) is (i-1)! 120 120
Provenance

Microsoft states: "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!". At i = 6 that is 5! = 120, an exact integer. Asserted as EXP(...) inside the engine so it exercises the log-gamma implementation against a value that is known exactly, rather than comparing two printed decimals. ROUND at 9 dp absorbs the round-trip through the exponential, which cannot be exact in binary floating point; 120 is recovered to far more than 9 decimals in the reference computation (mpmath: 119.99999999999999999997).

Matched
=ROUND(GAMMALN.PRECISE(0.5)-LN(SQRT(PI())),12) The classical value ln(Gamma(1/2)) = ln(sqrt(pi)), asserted as a difference of zero 0 0
Provenance

Not a published example; the standard closed form, checked against the engine's own LN, SQRT and PI so that it tests the log-gamma implementation rather than a printed constant. mpmath at 50 digits: loggamma(0.5) = 0.57236494292470008707, and ln(sqrt(pi)) = 0.57236494292470008707.

Matched
=GAMMALN.PRECISE(0) Zero, which the page excludes #NUM! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Gamma has a pole at 0, so its logarithm diverges. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Matched
=GAMMALN.PRECISE(-1) A negative argument, also excluded #NUM! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Note this is a STRICTER domain than GAMMA's: GAMMA(-3.75) is a documented finite value, but GAMMALN.PRECISE(-3.75) is excluded outright, because the gamma function alternates sign on the negative axis and its real logarithm would be undefined half the time. Asserted separately from the zero case for that reason. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Matched
=GAMMALN.PRECISE("abc") A non-numeric argument #VALUE! #VALUE!
Provenance

Excel documents: "If x is nonnumeric, GAMMALN.PRECISE returns the #VALUE! error value."

Matched

Google Sheets (executed 2026-08-31 via Drive import)

Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.

FormulaDescriptionResultExpectedVerdict
=ROUND(GAMMALN.PRECISE(4),12) Microsoft's documented worked example: the natural logarithm of the gamma function at 4 1.791759469 1.791759469228
Provenance

Microsoft publishes '=GAMMALN.PRECISE(4)' with the result 1.7917595. Derived independently two ways that agree to every digit mpmath prints at 50 places: mpmath's loggamma(4) = 1.7917594692280550008, and -- using the page's own stated identity that "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!" -- ln(3!) = ln(6) = 1.7917594692280550008. Rounds to exactly the published 1.7917595 at the 7 dp the page prints; asserted at 12 dp because that is still comfortably inside double precision.

Matched
=ROUND(EXP(GAMMALN.PRECISE(6)),9) The page's own identity: e raised to GAMMALN(i) is (i-1)! 120 120
Provenance

Microsoft states: "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!". At i = 6 that is 5! = 120, an exact integer. Asserted as EXP(...) inside the engine so it exercises the log-gamma implementation against a value that is known exactly, rather than comparing two printed decimals. ROUND at 9 dp absorbs the round-trip through the exponential, which cannot be exact in binary floating point; 120 is recovered to far more than 9 decimals in the reference computation (mpmath: 119.99999999999999999997).

Matched
=ROUND(GAMMALN.PRECISE(0.5)-LN(SQRT(PI())),12) The classical value ln(Gamma(1/2)) = ln(sqrt(pi)), asserted as a difference of zero 0 0
Provenance

Not a published example; the standard closed form, checked against the engine's own LN, SQRT and PI so that it tests the log-gamma implementation rather than a printed constant. mpmath at 50 digits: loggamma(0.5) = 0.57236494292470008707, and ln(sqrt(pi)) = 0.57236494292470008707.

Matched
=GAMMALN.PRECISE(0) Zero, which the page excludes #NUM! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Gamma has a pole at 0, so its logarithm diverges. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Matched
=GAMMALN.PRECISE(-1) A negative argument, also excluded #NUM! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Note this is a STRICTER domain than GAMMA's: GAMMA(-3.75) is a documented finite value, but GAMMALN.PRECISE(-3.75) is excluded outright, because the gamma function alternates sign on the negative axis and its real logarithm would be undefined half the time. Asserted separately from the zero case for that reason. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Matched
=GAMMALN.PRECISE("abc") A non-numeric argument #VALUE! #VALUE!
Provenance

Excel documents: "If x is nonnumeric, GAMMALN.PRECISE returns the #VALUE! error value."

Matched

LibreOffice Calc 25.8.7.3 (tested 2026-08-31)

FormulaDescriptionResultExpectedVerdict
=ROUND(GAMMALN.PRECISE(4),12) Microsoft's documented worked example: the natural logarithm of the gamma function at 4 1.791759469228 1.791759469228
Provenance

Microsoft publishes '=GAMMALN.PRECISE(4)' with the result 1.7917595. Derived independently two ways that agree to every digit mpmath prints at 50 places: mpmath's loggamma(4) = 1.7917594692280550008, and -- using the page's own stated identity that "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!" -- ln(3!) = ln(6) = 1.7917594692280550008. Rounds to exactly the published 1.7917595 at the 7 dp the page prints; asserted at 12 dp because that is still comfortably inside double precision.

Matched
=ROUND(EXP(GAMMALN.PRECISE(6)),9) The page's own identity: e raised to GAMMALN(i) is (i-1)! 120 120
Provenance

Microsoft states: "The number e raised to the GAMMALN.PRECISE(i) power, where i is an integer, returns the same result as (i - 1)!". At i = 6 that is 5! = 120, an exact integer. Asserted as EXP(...) inside the engine so it exercises the log-gamma implementation against a value that is known exactly, rather than comparing two printed decimals. ROUND at 9 dp absorbs the round-trip through the exponential, which cannot be exact in binary floating point; 120 is recovered to far more than 9 decimals in the reference computation (mpmath: 119.99999999999999999997).

Matched
=ROUND(GAMMALN.PRECISE(0.5)-LN(SQRT(PI())),12) The classical value ln(Gamma(1/2)) = ln(sqrt(pi)), asserted as a difference of zero 0 0
Provenance

Not a published example; the standard closed form, checked against the engine's own LN, SQRT and PI so that it tests the log-gamma implementation rather than a printed constant. mpmath at 50 digits: loggamma(0.5) = 0.57236494292470008707, and ln(sqrt(pi)) = 0.57236494292470008707.

Matched
=GAMMALN.PRECISE(0) Zero, which the page excludes #VALUE! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Gamma has a pole at 0, so its logarithm diverges. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Mismatch
=GAMMALN.PRECISE(-1) A negative argument, also excluded #VALUE! #NUM!
Provenance

Excel documents: "If x <= 0, GAMMALN.PRECISE returns the #NUM! error value." Note this is a STRICTER domain than GAMMA's: GAMMA(-3.75) is a documented finite value, but GAMMALN.PRECISE(-3.75) is excluded outright, because the gamma function alternates sign on the negative axis and its real logarithm would be undefined half the time. Asserted separately from the zero case for that reason. EXECUTED RESULT: all four LibreOffice builds (24.2.0.3, 24.8.7.2, 25.2.0.3, 25.8.7.3) return #VALUE! here instead of the documented #NUM! -- the same systemic #VALUE!-substitution pattern already recorded across this corpus, an error-code difference rather than a computation one.

Mismatch
=GAMMALN.PRECISE("abc") A non-numeric argument #VALUE! #VALUE!
Provenance

Excel documents: "If x is nonnumeric, GAMMALN.PRECISE returns the #VALUE! error value."

Matched

Docs & syntax