GAMMALN Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Troubleshooting
GAMMALN in ONLYOFFICE Spreadsheet Editor: officially documented arguments, reproducible worksheet examples, independently calculated expectations, domain restrictions and platform cautions.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
Quick answer: Enter =GAMMALN(x) to calculate the natural logarithm of the Gamma function for a strictly positive numeric input. The official ONLYOFFICE function reference confirms the signature. This page gives reproducible mathematical expectations, not tested ONLYOFFICE output.
What GAMMALN calculates
GAMMALN(x) is the natural logarithm of the Gamma function for a positive numerical x. For instance, Γ(6) is 120, so GAMMALN(6) has the mathematical result ln(120), about 4.78749174278. ONLYOFFICE explicitly specifies a numeric argument greater than zero in its GAMMALN help page.
A logarithm is useful for computations involving huge factorial-like products. Instead of generating a giant Γ(x) value first, you can work in log space. For example, log of a product is the sum of logs. This can reduce numerical overflow in statistical formulas but does not establish how a particular Desktop/web build implements its floating-point kernels. The natural logarithm here is base e, not base 10.
The name GAMMALN.PRECISE is a separately documented function. Its vendor description is also the natural logarithm of the Gamma function; the PRECISE suffix should not be interpreted as a measured accuracy improvement without side-by-side native version tests.
Exact ONLYOFFICE syntax and argument order
=GAMMALN(x)
| Position | Argument | Required | Type and documented rule | Default |
|---|---|---|---|---|
| 1 | x |
Yes | A numeric value greater than 0 (strictly positive). The vendor does not specify an invalid-input error label in this page. | None; no optional arguments. |
There is one positional argument and no documented optional or default parameter. The reference page uses the English function spelling shown above. Enter a number such as 2.5 directly, or reference a numeric input cell such as A2. Cell references are useful because every example can be recalculated by editing the input without rewriting the formula.
The ONLYOFFICE function-entry guide shows formulas starting with = and arguments separated by commas in the English instructions. This single-argument function has no separator ambiguity of its own; regional decimal separators and translated function names may still vary. Do not assert localized equivalents without an actual localized Desktop/web check.
Reproducible worksheet, from an empty workbook
- Create a new workbook in ONLYOFFICE Spreadsheet Editor and stay on its first worksheet. Set
A1tox (positive numeric input),B1toGAMMALN formulaandC1toIndependently calculated expected result. - Type the exact numeric inputs from column A of the table below into A2:A16. Do not type the backticks; they only identify code in this guide. Enter the values as numbers, not strings containing units.
- Select B2 and enter
=GAMMALN(A2). Press Enter. Fill or copy this relative-reference formula down through B16. Every row should then refer to its matching A-row. - Paste the expected numbers from column C into C2:C16. Format B and C as Number, showing enough decimal digits (or scientific notation for large values). Visual rounding is not numerical equality.
- In D1, write
Absolute difference, then enter=ABS(B2-C2)in D2 and fill down. Use=IF(D2<1E-9*MAX(1,ABS(C2)),"Within tolerance","Review")in E2 if your build supports the documentedIF,MAXandABSfunctions, then fill down. This tests the actual workbook only when you run it yourself; it was not executed during manuscript production. - If output differs, verify that A is numeric, formulas updated row references, and the result cells are not formatted as dates or fixed-width text. Run the same workbook on the specific Desktop and online builds you use before treating any compatibility claim as confirmed.
| Row | A: x | B: formula | C: expected mathematical value (12 significant digits) |
|---|---|---|---|
| 2 | 0.1 |
=GAMMALN(A2) |
2.25271265173 |
| 3 | 0.5 |
=GAMMALN(A3) |
0.572364942925 |
| 4 | 0.75 |
=GAMMALN(A4) |
0.203280951431 |
| 5 | 1 |
=GAMMALN(A5) |
0 |
| 6 | 1.5 |
=GAMMALN(A6) |
-0.120782237635 |
| 7 | 2 |
=GAMMALN(A7) |
0 |
| 8 | 2.5 |
=GAMMALN(A8) |
0.284682870473 |
| 9 | 3 |
=GAMMALN(A9) |
0.69314718056 |
| 10 | 4 |
=GAMMALN(A10) |
1.79175946923 |
| 11 | 5 |
=GAMMALN(A11) |
3.17805383035 |
| 12 | 6 |
=GAMMALN(A12) |
4.78749174278 |
| 13 | 7 |
=GAMMALN(A13) |
6.57925121201 |
| 14 | 10 |
=GAMMALN(A14) |
12.8018274801 |
| 15 | 20 |
=GAMMALN(A15) |
39.3398841872 |
| 16 | 30 |
=GAMMALN(A16) |
71.2570389672 |
How these results were derived: values are high-precision mathematical reference points calculated with mpmath and cross-checked against Python’s independently implemented math.gamma or math.lgamma, with relative numerical tolerance at most 1 × 10⁻¹² (using max(1, |value|) for scale). They are not claimed ONLYOFFICE outputs. Because C values are rounded to 12 significant digits for readability, allow a tolerance rather than testing B2=C2 bit-for-bit.
Advanced examples and mathematically justified checks
1. Work with large factorial-like values in log space. With A2 = 20, =GAMMALN(A2+1) targets ln(20!) = 42.3356164608. Unlike computing the full factorial and then taking a logarithm, this form avoids a large intermediate factorial value. It does not guarantee the editor will never overflow at more extreme inputs.
2. Confirm the recurrence identity. Enter 2.5 in G2, =GAMMALN(G2+1) in H2, and =LN(G2)+GAMMALN(G2) in I2. Both have mathematical expectation 1.20097360235. Compare with a tolerance instead of testing exact floating-point equality.
3. Reconstruct small Gamma values. =EXP(GAMMALN(6)) has mathematical expectation 120. At much larger inputs, EXP may overflow even when the logarithmic value itself is representable. Do not use this reconstruction as proof that the log approach lacks a numeric range advantage.
4. Build a positive-parameter Beta log expression. Put 2 in G3 and 3 in H3. =GAMMALN(G3)+GAMMALN(H3)-GAMMALN(G3+H3) targets ln(1/12) = −2.48490664979. Taking EXP afterward targets 1/12 if the implementation permits. This pattern is often numerically better behaved than direct multiplication of gamma factors.
5. Avoid using this as the signed logarithm of Gamma for negative x. Even though Γ(x) is mathematically defined at certain negative non-integers, ONLYOFFICE specifies x > 0 for GAMMALN. In addition, ln(Γ(x)) is not a real number wherever Γ(x) is negative. Do not extrapolate behaviour from a different spreadsheet application.
Errors, limits, and troubleshooting
- Domain check: The documented domain is x > 0. The individual official reference does not specify which native spreadsheet error label appears for zero, negative values, text/coercion failures, infinite intermediate results or excessive magnitudes.
- Wrong input type: Enter a true numeric cell, not a string such as
"2.5 kg". The source does not promise how arbitrary numeric-looking text is coerced. If using a pasted CSV, select A2 and confirm its underlying type. - Wrong function family:
GAMMALNis not interchangeable with a gamma distribution, a factorial, or a base-10 logarithm. Read the output units/meaning before nesting it in another formula. - Argument mistakes: This function takes exactly one required argument. Do not add a probability, cumulative flag, scale, or second numeric parameter. The vendor signature lists no default.
- Precision and overflow: Large gamma-related values may approach numeric limits. A log-space formula usually avoids a large intermediate factor but cannot eliminate all floating-point rounding, underflow, or overflow. Native ONLYOFFICE thresholds have not been measured here.
- Locale and editions: English documentation uses this name and a decimal point in its examples. Localized names and separator rules are not asserted. Current unversioned help coverage does not prove which historical Docs or Desktop builds first included the function.
- Scientific notation: A large value displayed as
8.84E+30is a formatting choice, not a different calculation. Change cell format and retain the underlying numeric precision. - Audit a surprising result: Reduce the sheet to the table above, compare against a reference value, save editor build information, test with a known constant (x=1 or x=0.5), and report exact steps; do not invent native error messages or screenshots.
Can I copy an Excel or Google Sheets formula verbatim?
Treat portability as unverified until the receiving app and specific version evaluate your saved workbook. ONLYOFFICE’s English function catalogue documents the name and basic operation; compatibility with other implementations’ coercion rules, precision and historical releases has not been established from these sources. In addition, a vendor help page is not direct runtime evidence for either the web or Desktop binary.
Documentation, platform context and evidence ledger
Official function-level claim sources (checked 2026-10-13 UTC):
- ONLYOFFICE — GAMMALN reference — English name, purpose, exact argument signature, and any explicitly documented domain restriction or error label.
- ONLYOFFICE Spreadsheet Editor — inserting functions — formula entry, function chooser, autocomplete, general comma-separated syntax and calculation controls; this is a general editor guide, not a historical feature-introduction statement.
- GAMMA — official ONLYOFFICE function reference (a distinct documented function).
- GAMMALN.PRECISE — official ONLYOFFICE function reference (a distinct documented function).
Verification separation: The page, function signature, category, and specified input restrictions are documentation-checked. The numerical values are independently calculated and cross-checked. They have not been executed in ONLYOFFICE Docs web, Desktop Editors, older releases or another spreadsheet UI; error strings outside explicitly documented cases are deliberately not assigned.
Version/edition boundary: The reviewed vendor help page is unversioned as to first supported release. The general editor guide describes spreadsheet formula entry for the product family, but does not supply a reproducible Desktop/web runtime version matrix. A reader using an older version should inspect the Function chooser and test a small numerical example. The examples are reference-based expectations, not native runtime measurements.
Runtime verification: Check critical formulas in the specific Desktop or web build you use, especially localized entry, undocumented input coercion and extreme values.