Contact

GAMMA Function (OpenOffice Calc)

Statistical Intermediate OpenOffice Calc

Evaluate the gamma function in Apache OpenOffice, with factorial and half-integer identities, negative noninteger values and pole/overflow cautions.

Verification status: Eight reference GAMMA formulas and two pole-error cases were typed directly and recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, with saved ODS results. Separate XLSX _xlfn.GAMMA import failures are retained; other calculations are independent references. How formula examples are checked

Quick answer: =GAMMA(1) has independent reference value 1.

Availability and version history

  • Introduced: First release not established. The verified current release source documents this function; historical introduction is still unconfirmed.
  • Supported in: Apache OpenOffice 4.1.16; this is not a final supported version.
  • Scope: Desktop Calc with English semicolon-separated formulas. Locale and other-product contracts may differ.
  • Checked: October 14, 2026. Eight reference GAMMA formulas and two pole-error cases were typed directly and recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, with saved ODS results. Separate XLSX _xlfn.GAMMA import failures are retained; other calculations are independent references.

What GAMMA returns

GAMMA returns Euler’s gamma function. For positive integers n, GAMMA(n)=(n−1)!, so GAMMA(5)=24 rather than 120. The function extends the factorial relation to other arguments, including many negative nonintegers; it is not a gamma-distribution probability function. Release implementation.

Syntax and arguments

=GAMMA(Number)

One numeric argument is required. Positive values are valid ordinary inputs. The implementation rejects zero and negative integers, where the gamma function has poles, but permits negative nonintegers subject to numerical range. Do not impose a positive-only rule copied from GAMMALN: the two functions intentionally have different domains.

The numeric helper supplies the corresponding endpoint and evaluation branches.

Reproducible reference examples

Values below are rounded to twelve decimal places. These eight formulas were typed directly and recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, then saved to ODS. The stored native values agree with the independent references; direct worksheet display used fewer decimal places.

Formula Independent reference
=GAMMA(0.5) 1.772453850906
=GAMMA(1) 1
=GAMMA(1.5) 0.886226925453
=GAMMA(2) 1
=GAMMA(5) 24
=GAMMA(10) 362880
=GAMMA(-0.5) -3.544907701811
=GAMMA(-1.5) 2.363271801207

Practical worksheet

To express n! through this function, use =GAMMA(n+1) for a nonnegative integer n. For example, =GAMMA(6) is 120 and =GAMMA(1) is 1, matching 0!=1. Add the shift explicitly in a worksheet formula so a factorial table is not off by one.

The half-integer identity GAMMA(0.5)=SQRT(PI()) gives approximately 1.772453850906. Then GAMMA(1.5)=0.5×GAMMA(0.5), approximately 0.886226925453. These provide checks independent of a table of integer factorials.

Advanced interpretation and checks

The recurrence GAMMA(x+1)=x×GAMMA(x) also explains signs on the negative noninteger axis. GAMMA(−0.5) is approximately −3.544907701811, while GAMMA(−1.5) is approximately 2.363271801207. Gamma values are not probabilities and need not be nonnegative.

For positive x and y, the beta-function identity is GAMMA(x)×GAMMA(y)/GAMMA(x+y). At x=2 and y=3 it gives 1/12. For large positive inputs, computing each gamma factor separately may overflow even when the final ratio is finite. A log-domain expression using GAMMALN can avoid those particular intermediates, provided all its arguments satisfy GAMMALN’s positive-domain requirement.

Boundaries and troubleshooting

Zero and negative integer arguments are rejected before evaluation. Inputs near those poles can yield very large magnitudes and be highly sensitive to tiny changes in the argument. A rounded displayed value near −1 is not enough to decide whether the actual stored number is the invalid integer or a nearby noninteger.

The implementation also has overflow and underflow checks. These small finite examples do not establish a safe universal upper input bound or accuracy near every pole. Do not replace a range error with zero or assume that a finite result proves an expression assembled from multiple gamma values is numerically stable.

Observed boundary checks

These additional cases were saved from the same 4.1.16 direct-entry session. Error displays are errors even where the ODS numeric attribute is zero.

Formula Native result or error
=GAMMA(0) Err:502
=GAMMA(-1) Err:502

Import-path limitation

The tested XLSX file encoded this function as _xlfn.GAMMA. Apache OpenOffice 4.1.16 retained that unresolved imported name and displayed #NAME? for all ten probes, including positive inputs. The direct-entry tests above succeeded in the same release. This is an import-mapping observation, not evidence that native GAMMA is absent. Validate a workbook’s imported function identity before interpreting its result.

Evidence and checking scope

The fresh native sheet retained all ten directly entered GAMMA formulas and a separately entered SUM control returning 7. The observed scope is the named release and method only; explanatory composite formulas are independently calculated unless specifically listed among the native cases. Other releases, locales and extreme-value limits were not established by these ordinary examples.