GAMMA Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Troubleshooting
GAMMA 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 =GAMMA(number) to calculate the Gamma function of a numeric input. The official ONLYOFFICE function reference confirms the signature. This page gives reproducible mathematical expectations, not tested ONLYOFFICE output.
What GAMMA does, and when to use it
The Gamma function extends the factorial relationship beyond whole numbers. For positive integers, the mathematical identity is Γ(n) = (n−1)!; for example, Γ(6) = 5! = 120. Fractional values are useful in continuous probability distributions, statistical modelling and engineering mathematics. The official ONLYOFFICE GAMMA help page explicitly identifies GAMMA(number) as a statistical function and specifically documents #NUM! for zero or negative integers.
This is not the gamma probability distribution: GAMMA.DIST is a separately named operation with four arguments. It is also not GAMMALN, which returns a logarithm rather than the gamma value. Use GAMMALN when gamma values may be huge or when multiplying many gamma-based factors; that changes the interpretation of the output.
For non-integer x the mathematical gamma function is an integral/analytic extension, but the application’s handling of unusual inputs and very large magnitudes is a separate native-test question. Numerical examples below restrict x to positive real values, where both the vendor’s documentation and the mathematical definition apply without the negative-argument edge case.
Exact ONLYOFFICE syntax and argument order
=GAMMA(number)
| Position | Argument | Required | Type and documented rule | Default |
|---|---|---|---|---|
| 1 | number |
Yes | A numeric value. The vendor separately documents #NUM! at zero and negative integers. |
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),B1toGAMMA 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
=GAMMA(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 |
=GAMMA(A2) |
9.51350769867 |
| 3 | 0.5 |
=GAMMA(A3) |
1.77245385091 |
| 4 | 0.75 |
=GAMMA(A4) |
1.22541670247 |
| 5 | 1 |
=GAMMA(A5) |
1 |
| 6 | 1.5 |
=GAMMA(A6) |
0.886226925453 |
| 7 | 2 |
=GAMMA(A7) |
1 |
| 8 | 2.5 |
=GAMMA(A8) |
1.32934038818 |
| 9 | 3 |
=GAMMA(A9) |
2 |
| 10 | 4 |
=GAMMA(A10) |
6 |
| 11 | 5 |
=GAMMA(A11) |
24 |
| 12 | 6 |
=GAMMA(A12) |
120 |
| 13 | 7 |
=GAMMA(A13) |
720 |
| 14 | 10 |
=GAMMA(A14) |
362880 |
| 15 | 20 |
=GAMMA(A15) |
1.21645100409e+17 |
| 16 | 30 |
=GAMMA(A16) |
8.84176199374e+30 |
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 identities
1. Calculate a factorial-like quantity without a factorial function. Put 6 in G2 and enter =GAMMA(G2) in H2. Mathematical result: 120, because Γ(6) = 5!. If you want 6!, use =GAMMA(G2+1), with mathematical result 720. This off-by-one adjustment is a frequent modelling mistake.
2. Verify a fractional Gamma constant. Enter =GAMMA(0.5) in an unused cell. Mathematical result: 1.77245385091 (√π), not 0.5!. You can compare with =SQRT(PI()); this is a mathematical identity, not a claimed live compatibility check.
3. Apply the recurrence relation. Put 2.5 in G3; in H3 enter =GAMMA(G3+1) and in I3 enter =G3*GAMMA(G3). Both sides should target 3.32335097045 mathematically. Prefer a tolerance comparison (=ABS(H3-I3)<1E-10) rather than exact equality if your build uses floating-point arithmetic.
4. Compute a Beta-function building block. With x=2 in G4 and y=3 in H4, enter =GAMMA(G4)*GAMMA(H4)/GAMMA(G4+H4). Independent mathematics predicts 0.0833333333333 (1/12). For much larger positive inputs, use the logarithmic approach with GAMMALN instead of multiplying potentially enormous intermediate results.
5. Use numerical domain guards. If A2 can be zero or a negative integer, the vendor documents #NUM! for direct GAMMA evaluation. Validate upstream input data; do not silently turn an invalid gamma value into zero. A decision formula such as =IF(A2>0,GAMMA(A2),"Check input") is appropriate when your use case only accepts positive values, though the exact lazy-evaluation and error behaviour still needs live confirmation.
Errors, limits, and troubleshooting
- Domain check: The ONLYOFFICE help page explicitly states
#NUM!for zero and negative integers. It does not provide a full error taxonomy for nonnumeric strings, very large magnitudes, or negative nonintegers. - 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:
GAMMAis 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 — GAMMA 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.
- GAMMALN — 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.