GAMMA.INV in ONLYOFFICE Spreadsheet Editor
Find gamma lower-tail quantiles with shape and scale, endpoint rules, independent inversion examples and legacy GAMMAINV compatibility.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =GAMMA.INV(0.95,1,2) is independently expected to return 5.991464547108, the 95th percentile of a gamma model with shape 1 and scale 2.
Availability and evidence scope
- Introduced: Original introduction release is not established by the checked sources.
- Available: Listed in current unversioned ONLYOFFICE help, checked October 18, 2026.
- Implementation inspected: Official SDKJS v10.0.0.169, commit
3679e0375a758d7dc59d31337a45461be3525ed8. The snapshot does not prove identical behavior in every installed editor. - Retired or deprecated: These sources do not establish retirement or formal deprecation. A legacy name alone does not mean the function has been removed.
- Testing: Numerical examples are independent mathematical expectations, and implementation discrepancies are labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed.
The examples use English function names and commas. Use your locale’s argument separator if different. Retain full precision in formulas; round only the displayed result. The examples describe function mechanics under the stated model, rather than establishing that your observations follow that model.
Syntax and output units
=GAMMA.INV(probability, alpha, beta)
=GAMMAINV(probability, alpha, beta)
All three arguments are required. Probability is a lower-tail cumulative probability, alpha is a positive shape, and beta is a positive scale. The output is an x value in the units of beta. It is not a probability or a density. GAMMAINV inherits the same inspected Calculate method; its legacy spelling does not require a second numerical method.
The gamma mean is alpha times beta. Beta is a scale, not a rate: an exponential rate of 0.5 per hour corresponds to shape 1 and scale 2 hours. For a threshold exceeded only 5% of the time under that model, use a lower-tail probability of 0.95, not 0.05.
Step-by-step: a hand-checkable percentile
- Put
0.95in A2 and format it as a percentage if desired. - Put shape
1in B2 and scale2in C2. - Enter
=GAMMA.INV(A2,B2,C2)in D2. - Independently calculate
=-C2*LN(1-A2)in E2, using the shape-1 identity. - The independent expectation for both is 5.991464547108.
For shape 1, the CDF is 1-exp(-x/beta). Solving p = 1−exp(−x/2) yields x = −2 ln(1−p). At p = 0.95, x = −2 ln(0.05). This derivation verifies the target mathematically; it does not claim that ONLYOFFICE uses that closed-form shortcut.
| Probability | Shape | Scale | Independently expected quantile |
|---|---|---|---|
| 0.5 | 1 | 2 | 1.386294361120 |
| 0.95 | 1 | 2 | 5.991464547108 |
| 0.95 | 1 | 4 | 11.982929094216 |
Doubling scale doubles every quantile while leaving shape fixed. Changing only the display format of beta does not convert hours to minutes; multiply numeric beta by 60 if changing units.
Advanced example: invert a shape-2 probability
For shape 2 and scale 2, the CDF at x = 4 is 1-3*EXP(-2), approximately 0.593994150290. Therefore =GAMMA.INV(1-3*EXP(-2),2,2) has independent expectation 4. Keep the probability expression unrounded; typing only 0.594 asks a slightly different question.
A practical calculation can retain the requested probability in one cell, the inverse result in another, and compare GAMMA.DIST(result,alpha,beta,TRUE) with the request. Inspect the absolute difference and decide a tolerance appropriate to the reported precision. In this source snapshot GAMMA.INV’s objective calls the older getGammaDist helper, while GAMMA.DIST uses lowerRegularizedGamma. Thus mathematical inversion is the aim, but these are not identical implementation paths and an exact runtime roundtrip is not guaranteed.
Probability boundaries and numerical limits
- The inspected source accepts p = 0 and explicitly returns 0, although current help describes a strictly positive probability.
- It rejects p<0 and p>=1 with internal
not_numeric, conventionally#NUM!. Thus=GAMMA.INV(1,2,2)predicts an error; a finite upper endpoint does not exist for the mathematical gamma distribution. - Alpha<=0 or beta<=0 also predicts
#NUM!. Alpha is continuous, not a degrees-of-freedom count that should be truncated. - Input conversion errors propagate. Use numeric probabilities rather than quoted percentage strings when reproducibility matters.
- Values extremely close to 1 can round to exactly 1 before evaluation, changing the case to an invalid endpoint.
The inverse starts around the mean and calls a shared bounded numerical solver. It allows up to 1,000 bracketing expansions and 500 refinement iterations. Bracketing failure is explicitly reported, but not every refinement stop sets an error flag. A returned number therefore does not establish an independently verified accuracy bound for arbitrary parameters. Check the CDF residual for consequential calculations, especially extreme probabilities, and avoid treating display rounding as proof of convergence.
For positive shape and scale the mathematical CDF is strictly increasing on positive x, so an interior probability has a unique mathematical quantile. That property is distinct from whether a particular floating-point solver obtained sufficient accuracy.
Compatibility and related functions
Recalculate representative formulas when moving a workbook between editors. Matching names do not guarantee identical argument coercion, array behavior, numerical precision or error handling. The scalar formulas here do not establish automatic spill behavior or a general import/export guarantee.
Official references
- ONLYOFFICE GAMMA.INV help, checked October 18, 2026.
- Official SDKJS implementation, 7528–7592, tag v10.0.0.169 and exact commit above.
- ONLYOFFICE GAMMAINV help, checked October 18, 2026.