Statistical functions

GAMMA.DIST

Known larger differences on 29,887 of 78,071 recorded answers

Of 78,071 recorded answers (77,975 in the answer bank and 96 workbook cells), 29,887 do not match: 164 differ by more than 16 ULP, 29,723 differ by at most 16 ULP. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicGAMMA.DIST
BulgarianGAMMA.DIST
CzechGAMMA.DIST
DanishGaMMA.FORDELING
GermanGAMMA.DIST
GreekGAMMA.DIST
English (Australia)GAMMA.DIST
English (United Kingdom)GAMMA.DIST
English (United States)GAMMA.DIST
SpanishDISTR.GAMMA.N
EstonianGAMMA.DIST
FinnishGAMMA.JAKAUMA
FrenchLOI.GAMMA.N
HebrewGAMMA.DIST
CroatianGAMMA.DIST
HungarianGAMMA.ELOSZL
IndonesianGAMMA.DIST
ItalianGAMMA.DIST
JapaneseGAMMA.DIST
KoreanGAMMA.DIST
LithuanianGAMMA.DIST
LatvianGAMMA.DIST
NorwegianGAMMA.FORDELING
DutchGAMMA.VERD.N
PolishROZKŁ.GAMMA
Portuguese (Brazil)GAMMA.DIST
Portuguese (Portugal)DIST.GAMA
RomanianGAMMA.DIST
RussianГАММА.РАСП
SlovakGAMMA.DIST
SlovenianGAMMA.DIST
Serbian (Latin)GAMMA.DIST
SwedishGAMMA.FÖRD
ThaiGAMMA.DIST
TurkishGAMA.DAĞ
UkrainianGAMMA.DIST
VietnameseGAMMA.DIST
Chinese (Simplified)GAMMA.DIST
Chinese (Hong Kong)GAMMA.DIST
Chinese (Traditional)GAMMA.DIST

Names from Microsoft's support site.

What it does

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

GAMMA.DIST(x,alpha,beta,cumulative) evaluates a gamma distribution with positive shape alpha and positive scale beta at nonnegative x. TRUE returns a cumulative probability; FALSE returns a density. Scale beta has the same units as x.

Shape one has the exponential distribution with rate 1/beta. A shape n/2 for positive integer n, with scale two, has the chi-square distribution with n degrees of freedom. These are mathematical relations; particular worksheet compositions still have their own stores.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=GAMMA.DIST(2,1,2,TRUE) is about 0.6321205588. The scale ratio is one, giving the exponential CDF 1-exp(-1).

=GAMMA.DIST(2,1,2,FALSE) is about 0.1839397206. That is a density, mathematically exp(-1)/2; it is not the probability of observing exactly the real-valued point two.

Quirks

Microsoft documents #VALUE! for nonnumeric x or shape/scale, and #NUM! for negative x or a nonpositive shape or scale. Beta is a scale, so replacing it by an exponential rate without taking a reciprocal changes the distribution.

At x=0 the mathematical density’s right-hand limit is zero for alpha>1, 1/beta for alpha=1 and unbounded for smaller positive alpha. The current fallback produces zero in the first case but #NUM! for the other two. Those are code facts; a mathematical limit alone is not evidence of Excel’s actual boundary return.

The cumulative half-shape branch currently uses an ordinary binary64 square root after dividing by beta. Its retained public-composition controls do not settle every root precision boundary. Large finite parameters can also overflow an intermediate ratio; finite inputs do not by themselves prove a successful candidate result.

GAMMA.DIST's prefactor carries GAMMALN(a+1) in the exponent, with its error

With RN(v) meaning v rounded to 64 bits on the x87 unit and then stored to binary64, the series arm and the density of GAMMA.DIST at integer shape a from 2 to 6 share r = RN(exp(t - x - GAMMALN(a+1))), with ln x stored, t = RN(a*ln x), and the difference held in the 64-bit registers. The cumulative answer is RN(r*S) with S the stored forward sum, and the density RN(r*a)/x, the division last; with a scale, y = RN(x/beta) comes first. So GAMMALN's own error is in every answer: at shape 2 the constant is GAMMALN(3), one unit above stored ln 2 (FN-GAMMALN-001).

Explanation (inferred): The form is read from noise and scored in part: one stored stage of the prefactor or the sum is still missing, with a root mean square of about 0.8 of 2^-53 at small x. Non-integer shapes depend on GAMMALN below 3, which is not identified. An earlier reading of a chopped exponential in this function was this constant.

FormulaExcelMathematical value
GAMMA.DIST(0.010000000000003386, 2, 1, TRUE)
Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading
Inputs and reference value

Number supplied through a cell.

x: 0.010000000000003386
0x3f847ae147ae1c1b

alpha: 2
0x4000000000000000

beta: 1
0x3ff0000000000000

cumulative: TRUE

mpmath regularized lower incomplete gamma at 800 bits, correctly rounded.

4.9667913340299445e-05
0x3f0a0a5081f5d243
4.966791334029942e-05
0x3f0a0a5081f5d23f
GAMMA.DIST(0.5000000000001851, 3, 1, TRUE)
Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading
Inputs and reference value

Number supplied through a cell.

x: 0.5000000000001851
0x3fe0000000000683

alpha: 3
0x4008000000000000

beta: 1
0x3ff0000000000000

cumulative: TRUE

mpmath regularized lower incomplete gamma at 800 bits, correctly rounded.

0.01438767796698471
0x3f8d774972ab2b85
0.014387677966984718
0x3f8d774972ab2b89

Inputs, build details and evidence

How to implement

Use D for ordinary binary64 storage and R for the stored 64-bit-significand operation.

For the current cumulative route, validate x and the two positive parameters, then store y=D(x/beta):

  1. At alpha=0.5, compute the ordinary binary64 square root of y and pass it to ERF.PRECISE. Keep divide before square root. Do not silently replace this code’s root by a separately staged public SQRT call at unmeasured boundaries.
  2. At alpha=1, call EXPON.DIST with (y,1,TRUE), retaining its corrected exponential-difference stages. Calling it with (x,1/beta,TRUE) changes a ratio into a stored reciprocal/product.
  3. For other shapes, evaluate the generic regularized lower gamma ratio P(alpha,y). Integer alpha does not select a finite-sum shortcut in the current code.

The source retains 68 half-shape composition controls on scales one, two and four, and shape-one controls including non-dyadic scales three and five. Those observations constrain the named compositions, rather than every inner approximation or scale.

For the current density candidate at positive x and alpha other than one:

y = R(x/beta)
t = R(alpha*LN(y))
G = stored GAMMALN(alpha+1)
prefix = current exponential-of-difference candidate(t,y,G)
ratio = R(alpha/x)
density = R(prefix*ratio)

The prefix corresponds mathematically to exp(t-y-G). Its producer and return stage are not fully identified; the current source retains a particular extended difference/exponential candidate. The independently stored alpha/x ratio and final multiplication are a separately measured consumer. Shapes one and x=0 retain a log-density fallback, rather than this branch.

For the cumulative example, y is exactly one; the CDF is about 1-exp(-1). Its density is a separate calculation. Do not transfer a supported CDF composition into the density merely because both come from the same distribution.

The notes retain earlier integer-shape prefactor findings and their scope. General gamma ratios, GAMMALN, the density prefix, endpoint publication and remaining report mismatches remain open. No published Handbook suite establishes whole-function agreement.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

GAMMA.DIST · 4 lines · calc-func/src/catalogue/distributions.rs on GitHub
54 gamma_dist "GAMMA.DIST" (4, 4) [V "x", V "alpha", V "beta", V "cumulative"] |s, a, sv| {
    let [x, alpha, beta] = nums::<3>(s, a)?;
    out(s, bg::gamma_dist_kernel(x, alpha, beta, flag(s, a, 3)?))
}

Kernels shared with other functions

Argument and result plumbing

  • flag catalogue/kit
  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20131Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics77,653
20430Windows, 64-bit, CPU not recorded194

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20527

Windows; bitness and CPU not recorded in this reading

GAMMA.DIST(0.010000000000003386, 2, 1, TRUE) returned 4.9667913340299445e-05 (0x3f0a0a5081f5d243). GAMMA.DIST(0.5000000000001851, 3, 1, TRUE) returned 0.01438767796698471 (0x3f8d774972ab2b85). Inputs were supplied through cells using Value2. These are controls from this environment, not a same-input comparison with another build.

Observed formulas and results
  • GAMMA.DIST(0.010000000000003386, 2, 1, TRUE) → 4.9667913340299445e-05
    0x3f0a0a5081f5d243 (cell-value2)
  • GAMMA.DIST(0.5000000000001851, 3, 1, TRUE) → 0.01438767796698471
    0x3f8d774972ab2b85 (cell-value2)

Excel 16.0 build 20131

Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics

77,653 captured inputs are indexed for this environment. Capture dates: 2026-07-16 to 2026-07-18. This is a reading count, not a comparison with another build.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

194 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

GAMMADIST is the compatibility spelling. GAMMA.INV finds a quantile; EXPON.DIST covers shape one; CHISQ.DIST selects shape n/2 and scale two. GAMMA and GAMMALN evaluate related special functions rather than a CDF.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents