Contact

GAMMA.DIST in ONLYOFFICE Spreadsheet Editor

Statistical Intermediate ONLYOFFICE Spreadsheet Editor

Calculate gamma densities and cumulative probabilities using shape and scale, including zero boundaries, legacy GAMMADIST and reproducible examples.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =GAMMA.DIST(4,2,2,TRUE) has independent expectation 0.593994150290. FALSE gives density 0.135335283237 for the same shape and scale.

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 shape–scale parameterization

=GAMMA.DIST(x, alpha, beta, cumulative)
=GAMMADIST(x, alpha, beta, cumulative)

All four arguments are required. Alpha is a positive shape, beta is a positive scale, and x is the measurement. TRUE returns the lower-tail CDF; FALSE returns the PDF. The inspected GAMMADIST class inherits the same calculation as GAMMA.DIST, so these names share the calculation path in this source snapshot.

The mean is alpha*beta and the variance is alpha*beta^2. Beta has the same units as x; it is not a rate. If another model gives rate lambda, the corresponding scale is 1/lambda. With alpha = 1, this is an exponential distribution of rate 1/beta. A density has inverse measurement units and need not be below 1. A continuous point probability is zero; interval probabilities require CDF differences.

Step-by-step: two-stage waiting time

Consider a model with shape 2 and scale 2 hours. Its mean is 4 hours and its standard deviation is SQRT(8) hours. This can model the sum of two independent exponential stages of equal rate, if that assumption fits the process.

  1. Enter shape 2 in B1 and scale 2 in B2.
  2. Put thresholds 2 and 4 in A5:A6.
  3. In B5 enter =GAMMA.DIST(A5,$B$1,$B$2,TRUE) and copy down.
  4. In C5 enter =GAMMA.DIST(A5,$B$1,$B$2,FALSE) and copy down.
Hours Independently expected CDF Independently expected density per hour
2 0.264241117657 0.183939720586
4 0.593994150290 0.135335283237

For shape 2, CDF = 1-EXP(-x/beta)*(1+x/beta). At x = 4 and beta = 2, this becomes 1-3*EXP(-2). The density becomes (x/beta)*EXP(-x/beta)/beta, or EXP(-2) at this point. These elementary identities provide independent checks rather than relying on another spreadsheet engine.

Advanced example: interval probability and unit conversion

The probability of a modeled wait from 2 through 4 hours is =GAMMA.DIST(4,2,2,TRUE)-GAMMA.DIST(2,2,2,TRUE), independently 0.329753032633. Using FALSE and subtracting densities would not calculate this probability.

If you change the measurement unit to minutes, multiply both x and beta by 60: =GAMMA.DIST(240,2,120,TRUE) represents the same event and CDF. The density per minute is the density per hour divided by 60, because its units change. Alpha remains 2. Keeping beta at 2 while changing only x would describe a different distribution.

For an ordinary quantile, GAMMA.INV solves for x at a requested lower-tail probability. It is sensible to substitute a computed quantile into a CDF as a numerical check, but the inspected inverse and distribution functions use different gamma-CDF helper implementations. An exact floating-point roundtrip is not promised.

Errors and zero-boundary behavior

The inspected wrapper rejects x<0, alpha<=0 and beta<=0 with internal not_numeric (#NUM!). Although current help describes x as positive, the source allows x = 0:

  • CDF at zero follows the lower incomplete-gamma calculation and is mathematically 0 for positive shape.
  • PDF at zero with alpha = 1 returns 1/beta; for beta = 2 this is 0.5.
  • PDF at zero with alpha > 1 returns 0.
  • PDF at zero with 0<alpha<1 is mathematically singular. The helper returns undefined and the wrapper predicts internal wrong_value_type (#VALUE!), rather than a useful numeric infinity. This is a source prediction, not a tested display.

The wrapper explicitly rejects a string cumulative argument before numeric conversion. Use TRUE or FALSE, not quoted text. Alpha and beta are not integer counts and should not be rounded merely to satisfy a model: positive fractional shapes and scales are meaningful.

The CDF helper uses series/continued-fraction calculations with iteration limits. Very small tails, extreme parameters and finite-precision subtraction need separate numerical validation; the modest examples above do not establish accuracy over every admissible input.

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