Contact

GAMMA.DIST Function (LibreOffice Calc)

Statistical Intermediate LibreOffice Calc

Calculate gamma-distribution densities and cumulative probabilities in LibreOffice Calc with explicit shape, scale and cumulative arguments.

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.DIST 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.DIST does

GAMMA.DIST models a nonnegative, continuous quantity using a gamma probability distribution. It answers two different questions depending on its final argument:

  • Cumulative probability (CDF): What proportion of modeled outcomes are at or below a specified value x? Use TRUE() or 1.
  • Probability density (PDF): How concentrated is the modeled distribution around x? Use FALSE() or 0. A density is not the probability of observing exactly x.

The gamma distribution can describe positive waiting times or total durations of several events in a mathematical model. Applying it to real-world data requires you to check whether that distribution fits the data; a successful formula calculation does not validate the modeling assumption.

For example, =GAMMA.DIST(5;2;2;TRUE()) returns 0.71270250481635 (Calc-tested). If the quantity is a duration measured in hours, the model assigns about 71.27% probability to a duration of five hours or less. This is a probability under the specified model, not a statement about observed measurements.

Syntax in LibreOffice Calc

=GAMMA.DIST(Number; Alpha; Beta; Cumulative)
Argument Required? Meaning and valid values
Number Yes Nonnegative evaluation value x in the same units as your data.
Alpha Yes Positive shape parameter α > 0; need not be an integer.
Beta Yes Positive scale parameter β > 0, in units of Number. It is not the rate 1/β.
Cumulative Yes TRUE()/1 gives the CDF; FALSE()/0 gives the PDF. Official Help specifies any other numeric value as cumulative. Use Boolean values for clarity.

All four arguments are required for this modern function. The older GAMMADIST has a different syntax with an optional fourth argument; that is not permission to omit Cumulative here. LibreOffice’s English-language examples use semicolons between arguments and a period as decimal mark. Your application’s locale and localized function-name settings can change what you type; use the Function Wizard when converting examples. The explicit TRUE() and FALSE() functions avoid confusing a number with a Boolean flag.

Official syntax and release scope: LibreOffice Help, Statistical Functions Part Two, GAMMA.DIST subsection, checked 2026-10-13: https://help.libreoffice.org/latest/en-US/text/scalc/01/04060182.html . The page says GAMMA.DIST has been available since LibreOffice 4.3, identifies the compatibility namespace COM.MICROSOFT.GAMMA.DIST, and says this function is not part of ODF 1.3 OpenFormula. Do not generalize that statement to newer standards without separately checking them.

Start here: exact formulas and outputs

The numbers below were produced by native Calc formula execution and checked against independently calculated gamma probabilities. Display formatting may round the number of shown digits.

Formula Calc-tested result Interpretation
=GAMMA.DIST(2;1;1;TRUE()) 0.864664716763387 CDF for shape 1, scale 1, at x=2.
=GAMMA.DIST(2;1;1;FALSE()) 0.135335283236613 Density at x=2 for the same model.
=GAMMA.DIST(2;2;1;TRUE()) 0.593994150290162 About 59.40% of the modeled outcomes are ≤2.
=GAMMA.DIST(2;2;1;FALSE()) 0.270670566473225 Density; do not report as a 27.07% point probability.
=GAMMA.DIST(5;2;2;TRUE()) 0.71270250481635 Cumulative probability up to five units.
=GAMMA.DIST(5;2;2;FALSE()) 0.10260624827987 Density per unit at five units.
=GAMMA.DIST(7.5;3;1.5;TRUE()) 0.87534798051692 Demonstrates a decimal input and scale.
=GAMMA.DIST(1.5;0.5;0.8;TRUE()) 0.94719248858389 A noninteger shape is valid.

The value 0.864664716763387 above also checks the official Help example, which rounds the same CDF to 0.86 for =GAMMA.DIST(2;1;1;1).

Reproducible example A: cumulative share of modeled service times

Set up a small sheet as follows. These inputs are illustrative parameters, not observed estimates:

Cell Label Enter
A2 Elapsed hours 3
B2 Shape α 2
C2 Scale β, hours 2
D2 Cumulative probability =GAMMA.DIST(A2;B2;C2;TRUE())
E2 Density per hour =GAMMA.DIST(A2;B2;C2;FALSE())

Expected Calc outputs for the formulas in D2 and E2 are 0.44217459962893 and 0.16734762011132 respectively. The 44.22% value is the probability of a modeled completion time of three hours or less; the density value has units of inverse hours. These input values were tested through worksheet references in a separate native evidence workbook (Inputs.A2:C2).

If A2 increases while B2 and C2 are fixed, the cumulative result cannot decrease mathematically; its limit is 1 as x grows. The density, however, can rise and then fall. Do not try to infer an exact-time probability by reading a density as a percentage.

Reproducible example B: probability between two thresholds

For a gamma distribution with α = 2 and β = 2, calculate the probability that the value lies between 3 and 5:

=GAMMA.DIST(5;2;2;TRUE())-GAMMA.DIST(3;2;2;TRUE())

The independent mathematical result is approximately 0.27052790518742. Unlike the individual endpoint values, this combined subtraction is independently calculated but not separately tagged as a native numerical assertion in the saved run. For a reproducible sheet, place lower limit 3 in F2 and upper limit 5 in G2, then use:

=GAMMA.DIST(G2;$B$2;$C$2;TRUE())-GAMMA.DIST(F2;$B$2;$C$2;TRUE())

The calculation requires G2 >= F2 >= 0, with a common, unchanged shape and scale on both sides. A negative result usually means the limits were reversed. Format as a percentage to show about 27.05%.

Reproducible example C: a compact CDF table

Enter 2 into B2 (shape), 1 into C2 (scale), and the values 0, 1, 2, 3, 5 in A5:A9. In B5 enter:

=GAMMA.DIST(A5;$B$2;$C$2;TRUE())

Fill through B9. Corresponding independently calculated CDF values are 0, 0.264241117657115, 0.593994150290162, 0.800851726528545, and 0.959572318005487. The native evidence contains direct formula tests for this same distribution at all these x-values. A scatter plot of x against B5:B9 makes a cumulative curve; plot PDF values separately rather than mixing their vertical units.

How the mathematics works (independent explanation)

With shape α > 0, scale β > 0, and x > 0, the gamma density is

f(x; α, β) = x^(α−1) × exp(−x/β) / [Γ(α) × β^α]

GAMMA.DIST(x;α;β;FALSE()) evaluates this density. GAMMA.DIST(x;α;β;TRUE()) evaluates its integral from zero through x, the regularized lower incomplete gamma ratio P(α,x/β). It follows that 0 ≤ CDF ≤ 1 and that a density can be larger than 1 in some continuous models without violating probability rules. Probability comes from area under the density, not its height at a point.

The model’s mean is αβ, variance is αβ², and standard deviation is √α·β. If α=1, the distribution becomes exponential, so

F(x) = 1−exp(−x/β)
f(x) = exp(−x/β)/β   (x ≥ 0)

For α=1, β=1, x=2, these expressions independently give 0.864664716763387 (CDF) and 0.135335283236613 (PDF), matching native Calc. The Gamma function GAMMA(α) in the density formula is not the same operation as GAMMA.DIST or its inverse; do not substitute the GAMMA.INV function for GAMMA(α).

Advanced techniques

1. Translate desired completion probability into a threshold

If your question is how long until 80% are expected to finish, use the inverse distribution, not density:

=GAMMA.INV(0.8;2.5;1.4)

Calc-tested result: 5.1024932886543 units. The matching round trip is =GAMMA.DIST(GAMMA.INV(0.8;2.5;1.4);2.5;1.4;TRUE()), which mathematically and in the tested suite evaluates to 0.8 (up to floating-point rounding).

2. Compute a right-tail probability

The chance of exceeding threshold t is 1 - CDF(t):

=1-GAMMA.DIST(5;2;2;TRUE())

Expected: approximately 0.28729749518365. For probabilities extremely close to 1, subtracting can lose precision because the CDF itself may round to 1; the tested =GAMMA.DIST(100;1;1;TRUE()) returned 1 despite a mathematically nonzero tail. If an extreme upper-tail probability is essential, use a numerically stable method verified separately instead of interpreting 0 from that subtraction as an exact zero probability.

3. Convert a rate parameter into Calc’s scale

Some statistics references use a rate λ instead of scale β. If the rate is 0.5 per hour, enter scale 1/0.5 = 2 hours:

=GAMMA.DIST(3;2;1/0.5;TRUE())

Mathematical expectation: 0.44217459962893. Passing 0.5 as Beta instead would describe a different distribution. Ensure measured quantities and Beta use compatible units.

4. Build a validation wrapper

For nonnegative x and positive alpha and beta, with a Boolean flag in D2:

=IF(OR(NOT(ISNUMBER(A2));NOT(ISNUMBER(B2));NOT(ISNUMBER(C2));A2<0;B2<=0;C2<=0);NA();GAMMA.DIST(A2;B2;C2;D2))

This is a recommended editorial validation pattern, not a separately native-tested assertion in this batch. Check your own Calc release and adjust if the inputs are dates, percentages stored as text, or other types. For strict flag validation, add a separate cell with a Data Validity rule allowing only TRUE/FALSE.

Errors, boundaries and troubleshooting

The following are observations from native Calc 25.2.3.2. Error displays can vary with locale, data entry method, and later releases; they are not universal contracts.

Input/formula Observed result Interpretation or remedy
=GAMMA.DIST(-1;2;1;1) Err:502 Negative x: not in the nonnegative gamma domain.
=GAMMA.DIST(2;0;1;1) Err:502 Shape must be strictly positive.
=GAMMA.DIST(2;2;0;1) Err:502 Scale must be strictly positive.
=GAMMA.DIST(2;2;1) Err:511 Required cumulative argument omitted.
=GAMMA.DIST(2;"text";1;1) #VALUE! Text that Calc cannot coerce to a numeric shape.
=GAMMA.DIST(0;0.5;1;0) #DIV/0! At zero, the mathematical density diverges for shape less than 1.
=GAMMA.DIST(0;2;1;FALSE()) 0 Density at zero for a shape greater than 1.
=GAMMA.DIST(0;1;1;FALSE()) 1 Density at zero for an exponential distribution of scale 1.
=GAMMA.DIST(2;2;1;) 0.270670566473225 A present but blank final argument was treated like FALSE in the tested version. Do not rely on this in place of an explicit flag.
=GAMMA.DIST(2;2;1;-2) 0.593994150290162 Negative nonzero flag selected the CDF in the tested version; explicit TRUE is clearer.

Diagnose wrong numbers: (1) check whether you requested CDF or PDF; (2) make sure the Beta parameter is a scale rather than a rate; (3) check whether x and Beta use the same units; (4) check if x is stored as text, including decimal commas imported from another locale; (5) verify whether the result is rounded by cell formatting rather than actually zero or one.

Compatibility, aliases and availability

LibreOffice’s official Help documents GAMMA.DIST from LibreOffice 4.3 onward and uses the COM.MICROSOFT.GAMMA.DIST namespace for file-format interoperability. The same Help page lists GAMMADIST as the older, distinct spelling, with an optional fourth argument. The workbook tests also confirmed =GAMMADIST(2;2;1;1) agrees with modern cumulative mode in Calc 25.2.3.2.

This review does not claim direct execution in Excel, Google Sheets, or LibreOffice on Windows/macOS. Export/import workflows, locale names, and formula namespaces can affect interoperability and must be retested where important. The Help page’s statement that this name is not part of ODF 1.3 OpenFormula is a versioned standards statement, not proof of incompatibility in every ODS file.

  • GAMMA.INV — reverse the cumulative distribution to find a percentile threshold.
  • GAMMADIST — legacy gamma distribution name and optional flag.
  • GAMMAINV — legacy inverse name.
  • GAMMA — Gamma special function, which is not a probability quantile.
  • POISSON.DIST — a discrete event-count distribution, not interchangeable with a continuous waiting-time model.
  • CHISQ.DIST — related mathematically to a special gamma-distribution parameterization.

Official references