GAMMA.INV Function (LibreOffice Calc)
Learn the GAMMA.INV function in LibreOffice Calc: Values of the inverse gamma distribution.
Verification status: Saved LibreOffice Calc 25.2.3.2 observations and supplementary LibreOfficeDev 26.8.0.0.alpha0 XLSX results were reviewed for the identified examples. The historical stable installation was not rerun; the guide distinguishes those evidence sets. How formula examples are checked
Availability and version history
- Introduced: LibreOffice 4.3, explicitly stated in official GAMMA.INV Help.
- Availability: Supported in LibreOffice 26.8.1.1, confirmed by the versioned function registry. This is not a final supported version.
- Scope: Desktop Calc; formula names and separators depend on language/settings. Other spreadsheet products need separate compatibility checks.
- Checked: October 14, 2026. Documentation/source evidence; saved 25.2.3.2 native observations and supplementary development-build XLSX tests are scoped separately below.
Validation scope: The saved native observations in this guide were produced in LibreOffice Calc 25.2.3.2 on Linux on October 13, 2026. This revision verified the corresponding saved ODS values against the result ledgers; it did not rerun that historical installation. Supplementary numerical cases were recalculated through imported XLSX files in LibreOfficeDev 26.8.0.0.alpha0 (build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5). That development-build/import check is separate from direct formula entry and from the stable-release support evidence.
What GAMMA.INV does
GAMMA.INV computes a percentile (quantile) of a gamma probability distribution. Provide a cumulative probability p and the distribution’s shape Alpha and scale Beta; Calc returns the nonnegative threshold x at which the modeled cumulative probability reaches p.
In plain language, if a model assigns gamma-distributed total service times, =GAMMA.INV(0.8;2.5;1.4) finds the time by which 80% of modeled jobs have finished. Calc-tested result: approximately 5.10249328865428 units. This is a model output, not a forecast backed by measurements unless you have separately fitted and validated the model.
The inverse operates on the cumulative distribution function (CDF), not on gamma density and not on the mathematical gamma special function GAMMA. LibreOffice Help also calls the same inverse operation GAMMAINV, a historical alternative name. The modern spelling is GAMMA.INV.
Exact Calc syntax, arguments and defaults
=GAMMA.INV(Number; Alpha; Beta)
| Argument | Required? | Definition | Examples and cautions |
|---|---|---|---|
Number |
Yes | Cumulative probability p. For finite interior quantiles use 0 < p < 1. |
0.8, 80% (as a numeric percentage), or a cell containing 0.8. A number such as 80 is not equivalent to 80%. |
Alpha |
Yes | Positive shape parameter α > 0. Fractional positive values are allowed. |
1, 2.5, 0.5. Do not confuse Alpha with a significance threshold or confidence level. |
Beta |
Yes | Positive scale parameter β > 0. It has the same units as the returned threshold. |
2 hours, 1.4 days, etc., depending on the underlying model. If your source specifies a rate λ, use β = 1/λ. |
No arguments are optional. In LibreOffice’s English Calc syntax, arguments are separated by semicolons; these examples use a period decimal mark. A localized interface may require different separators/decimal signs or translated names; check your installation’s Function Wizard. The results are numeric and should not be formatted as percentages when they represent times or quantities.
Official product statement: LibreOffice Calc Help: Statistical Functions Part Two — GAMMA.INV, checked 2026-10-13. It lists GAMMA.INV(Number; Alpha; Beta) and availability since LibreOffice 4.3, states the compatibility namespace COM.MICROSOFT.GAMMA.INV, and says that this function name is not part of OpenDocument 1.3 OpenFormula. That versioned statement does not establish its status in later ODF editions.
Core formulas with reproducible results
The following results were actually calculated in LibreOffice Calc 25.2.3.2 and independently compared to SciPy’s gamma ppf for the same shape and scale. The displayed number of digits in a Calc cell depends on formatting.
| Formula | Calc-tested result | Interpretation |
|---|---|---|
=GAMMA.INV(0.8;1;1) |
1.60943791243410 | Official example, about 80% of shape-1/scale-1 outcomes are at or below this threshold. |
=GAMMA.INV(0.5;1;1) |
0.693147180559945 | Median of an exponential distribution with mean 1 (gamma shape 1). |
=GAMMA.INV(0.9;1;2) |
4.60517018598809 | 90th percentile when shape 1, scale 2. |
=GAMMA.INV(0.5;2;3) |
5.03504097004998 | Median of a positive, right-skewed gamma distribution. |
=GAMMA.INV(0.95;2;2) |
9.48772903678115 | Upper 95th percentile for shape 2, scale 2. |
=GAMMA.INV(0.025;4;2) |
2.17973074725265 | Lower 2.5th percentile. |
=GAMMA.INV(0.99;0.5;3) |
9.95234490153183 | 99th percentile with fractional shape. |
=GAMMA.INV(0.001;3;1) |
0.190533377568403 | A small, nonzero lower-tail threshold. |
=GAMMA.INV(0.999;3;1) |
11.22887224241261 | A high-tail threshold. |
=GAMMA.INV(0.5;0.25;0.1) |
0.00436738023528734 | A fractional shape and small scale. |
The official LibreOffice Help example =GAMMA.INV(0.8;1;1) is shown there rounded to 1.61. The more precise tested value above is consistent with that official example.
Example A: find the 75th percentile from worksheet cells
Enter the illustrative input values below in a Calc sheet (for example a sheet named Inputs). These are hypothetical parameters, not measurements from a real process.
| Cell | Enter | Meaning |
|---|---|---|
| B2 | 2 |
Shape α. |
| C2 | 2 |
Scale β in hours. |
| D2 | 0.75 |
Target cumulative probability. |
| E2 | =GAMMA.INV(D2;B2;C2) |
75th-percentile time, in hours. |
| F2 | =GAMMA.DIST(E2;B2;C2;TRUE()) |
Verify that the time corresponds to 75% cumulative probability. |
Expected E2: 5.38526905777939 hours. Expected F2: 0.75 (allowing negligible floating-point rounding). Both the cross-sheet equivalent =GAMMA.INV(Inputs.D2;Inputs.B2;Inputs.C2) and its GAMMA.DIST round trip were native-tested in the saved validation workbook.
Formatting F2 as a percentage will show 75%. Formatting E2 as a percentage would be misleading: E2 is the time threshold, not the percentage.
Example B: practical completion time planning
Suppose an illustrative gamma model for job turnaround has shape 2.5, scale 1.4 days. Ask how many days you would allow for an 80% or 20% completion percentile:
=GAMMA.INV(0.8;2.5;1.4)
=GAMMA.INV(0.2;2.5;1.4)
Calc-tested results: 5.10249328865428 days and 1.63977401408878 days respectively. The 80th percentile is higher than the 20th percentile because the gamma CDF is nondecreasing. Do not interpret their difference as a probability; their difference is a difference in modeled times. If you require an integer number of whole days of capacity, a separate rounding policy is needed; it is not part of GAMMA.INV itself.
Example C: a central 95% modeled interval
For a gamma distribution with shape 5 and scale 2, two percentile formulas define a central probability interval:
=GAMMA.INV(0.025;5;2)
=GAMMA.INV(0.975;5;2)
The independent mathematical results are approximately 3.24697278023684 and 20.4831773508074 (rounded; see SciPy evidence for full precision). The native test suite includes both exact percentile inverse/CDF round trips at 2.5% and 97.5%, confirming the corresponding inverse thresholds are passed back to the cumulative function accurately in Calc. The two bounds enclose 95% of probability under the assumed gamma distribution, not necessarily 95% of future observations if that distribution does not fit the process. These are distribution quantiles, not a confidence interval for estimated model parameters.
To make this completely reproducible in a sheet, put 5 in B2 and 2 in C2; then place 0.025 and 0.975 in D5:D6 and use =GAMMA.INV(D5;$B$2;$C$2) in E5, filling down.
What is calculated mathematically?
For α > 0, β > 0, and x ≥ 0, the gamma CDF is
F(x; α, β) = [1 / Γ(α)] × integral from 0 to x/β of t^(α−1) × e^(−t) dt
The inverse gamma CDF is the value x = F^{-1}(p; α, β) satisfying F(x; α, β) = p, for interior probabilities 0 < p < 1. GAMMA.INV finds that threshold numerically. The inverse is not the reciprocal 1/F(x) or the inverse of the gamma function Γ(x). It is also different from a probability density function, which has units of 1/quantity.
The gamma distribution’s mean is αβ and its variance is αβ²; a percentile is generally not the same as the mean. For example, when α=2, β=3, the mean is 6 but the median is 5.03504097004998 (Calc-tested). This distinction matters for right-skewed waiting-time distributions.
Special case α = 1: the gamma CDF reduces to the exponential CDF, and its inverse can be written exactly as
F^(-1)(p; 1, β) = −β × ln(1−p), for 0 < p < 1
For p=0.8, β=1, this produces -LN(0.2) ≈ 1.60943791243410, agreeing with the native GAMMA.INV(0.8;1;1) result. This is a useful independent check but is not an alternative formula for arbitrary shape α.
Advanced usage and quality checks
1. Prove an inverse calculation by round-tripping through GAMMA.DIST
With p=0.8, α=2.5, β=1.4, the direct check is:
=GAMMA.DIST(GAMMA.INV(0.8;2.5;1.4);2.5;1.4;TRUE())
Mathematical expectation: 0.8. The native suite tested analogous nested GAMMA.INV / GAMMA.DIST formulas for six sets of model parameters and obtained the original probabilities to floating-point accuracy. The exact nested formula above is given as a reproducible recommendation, not a separately counted native assertion. Using the final TRUE() is essential: FALSE() would evaluate the PDF, which does not invert the quantile.
2. Change from rate to scale correctly
Some statistical sources provide a rate parameter λ instead of Calc’s scale parameter β. If λ is 0.5 events per hour, β is 1/0.5 = 2 hours. A 90th-percentile threshold for a shape-2 model is therefore:
=GAMMA.INV(0.9;2;1/0.5)
This is a mathematically specified editorial example (not a separately counted native assertion). Inserting 0.5 directly as the Beta argument instead would scale the threshold differently. Always record the convention used by your statistical source or fitted model.
3. Scale all threshold units consistently
If α and p stay fixed, the gamma percentile is proportional to β. For example, moving from β=1 hour to β=60 minutes multiplies the numerical threshold by 60, provided the real-world distribution has not changed. This follows from the parameterization F(x;α,β)=F(x/β;α,1). Changing beta without a corresponding change of units changes the underlying model.
4. A recommended input-validation wrapper
Suppose A2 holds the target probability, B2 holds Alpha, C2 holds Beta. For an interior finite quantile, use the following editorial safeguard:
=IF(OR(NOT(ISNUMBER(A2));NOT(ISNUMBER(B2));NOT(ISNUMBER(C2));A2<=0;A2>=1;B2<=0;C2<=0);NA();GAMMA.INV(A2;B2;C2))
This deliberately excludes the lower boundary p=0 to avoid misunderstanding the exact zero threshold as a useful finite percentile. The guard is a recommended pattern, not a separately executed native test in this batch. For a model that explicitly wants the mathematical lower endpoint, treat p=0 as a separate case. Consider Calc Data Validity to restrict probabilities to [0,1] and ensure columns contain numbers rather than imported text.
5. Compare percentiles without treating them as error bars
For any fixed positive α and β, higher cumulative p produces a threshold at least as high. Thus comparing GAMMA.INV(0.9;α;β) and GAMMA.INV(0.5;α;β) describes distribution skewness and planning conservatism under the model. It does not directly measure parameter-estimation uncertainty. If α and β were estimated from a small sample, account separately for uncertainty in those estimates.
Errors, boundary behavior, precision and troubleshooting
The table records native observations from LibreOffice Calc 25.2.3.2 on Linux, as entered through UNO in an otherwise clean test document. The error strings are observations, not promises for all LibreOffice versions or locales.
| Input/formula | Calc observation | Explanation and action |
|---|---|---|
=GAMMA.INV(0;2;1) |
0 | Lower probability endpoint returned the mathematical minimum in this version. A guard using p>0 may intentionally reject it when an interior finite quantile is required. |
=GAMMA.INV(1;2;1) |
Err:502 | The upper gamma quantile is unbounded, so a finite inverse at p=1 is not meaningful. |
=GAMMA.INV(-0.1;2;1) |
Err:502 | Negative cumulative probability is invalid. |
=GAMMA.INV(1.1;2;1) |
Err:502 | Probabilities above 1 are invalid. |
=GAMMA.INV(0.5;0;1) |
Err:502 | Shape must be greater than zero. |
=GAMMA.INV(0.5;-1;1) |
Err:502 | Negative shape is invalid. |
=GAMMA.INV(0.5;2;0) |
Err:502 | Scale must be greater than zero. |
=GAMMA.INV(0.5;2;-1) |
Err:502 | Negative scale is invalid. |
=GAMMA.INV(0.5;2) |
Err:511 | Beta was omitted; all three arguments are required. |
=GAMMA.INV(0.5;2;) |
Err:502 | An explicitly empty scale behaves as invalid/zero in the tested setup. |
=GAMMA.INV("text";2;1) |
#VALUE! | Unconvertible text in a numeric probability argument. |
=GAMMA.INV("0.5";2;1) |
1.67834699001666 | Numeric text was coerced in this native test; avoid depending on text-to-number coercion across locales. |
=GAMMA.INV(0.999999999999;2;1) |
31.0998751499492 | A very high percentile can yield a comparatively large threshold; keep sufficient precision. |
If a percentile looks wrong, check that: (1) the probability was supplied as 0.9 or 90%, not 90; (2) Beta is a scale, not a rate; (3) shape and scale are strictly positive; (4) you are not confusing quantiles with densities; (5) the model time units are consistent; and (6) cell display formatting has not hidden precision.
When p approaches 1, numerical root-finding can become more sensitive. In the tested version a probability extremely close to 1 returned a finite result; exactly 1 returned an error. Check the round-trip CDF and use explicit probability tolerances when applying the result to a decision threshold. Avoid reporting more significant digits than your fitted model justifies.
Compatibility, legacy names and version scope
LibreOffice’s official Help describes GAMMA.INV as having the same numerical purpose as the older GAMMAINV, with the dotted name introduced for cross-suite compatibility. Both were exercised in native Calc 25.2.3.2: the suite verified =GAMMAINV(0.5;2;3) and =GAMMA.INV(0.5;2;3) produced 5.03504097004998, and the analogous p=0.8/α=1/β=1 calculations agreed. That is a tested numerical comparison in this Calc version, not a guarantee of formatting/namespace equivalence in all file types.
The official source specifies LibreOffice 4.3 as the introduction of the dotted function and the namespace COM.MICROSOFT.GAMMA.INV. Its OpenFormula comment refers specifically to ODF 1.3. This review does not claim native execution on Windows/macOS, in Microsoft Excel, or in Google Sheets, and does not assert that all third-party ODS/XLSX import paths preserve formulas identically. For cross-suite work, validate both the formula interpretation and saved/reopened result in the target application.
The formulas here use the English-language, semicolon-separated Calc interface. If your locale uses decimal commas, do not copy the period decimal notation without checking the locale settings. Older LibreOffice versions may not recognize GAMMA.INV, regardless of whether the legacy GAMMAINV is recognized.
Related Calc functions
- GAMMA.DIST — calculate cumulative probability or density instead of the inverse; the other complete proposal in this batch.
- GAMMAINV — legacy inverse-gamma spelling.
- GAMMADIST — legacy gamma-distribution spelling with an optional fourth argument.
- GAMMA — evaluates the gamma special function Γ(x), not an inverse CDF.
- GAMMALN — log gamma special function used in probability mathematics.
- CHISQ.INV — χ² inverse, mathematically related to gamma quantiles under a specific parameterization, but not interchangeable without adjusting parameters.