The Excel GAMMA function returns the value of the gamma function Γ(x) — a continuous extension of the factorial. For a positive integer n, GAMMA(n) equals (n−1)!.
Syntax
| Argument | Description | |
|---|---|---|
number | Required | The value at which to evaluate the gamma function. Any real number except zero and negative integers (those return an error). |
How to use it
The gamma function generalises the factorial to all real (and complex) numbers. The key identity is Γ(n) = (n−1)! for positive integers:
Because it is continuous, GAMMA also works on fractions: =GAMMA(0.5) famously equals the square root of π. It satisfies the recurrence Γ(x+1) = x · Γ(x), which is why it lines up with the factorial at the integers.
Watch the poles: the gamma function is undefined at zero and at every negative integer (−1, −2, …). =GAMMA(0) or =GAMMA(-2) returns #NUM!. Negative non-integers like −0.5 are fine.
For the natural log of the gamma function — needed when values get astronomically large — use GAMMALN or GAMMALN.PRECISE.
Try it: interactive demo
Pick a GAMMA example to see the formula and its result.
Practice workbook
Frequently asked questions
How does GAMMA relate to the factorial?
GAMMA(n) = (n−1)!. So GAMMA(5) = 4! = 24 and GAMMA(1) = 0! = 1. To get n! directly, use =GAMMA(n+1) or simply FACT(n).Why does GAMMA(0.5) equal about 1.7725?
When does GAMMA return an error?
#NUM!. Negative non-integers such as −1.5 are valid.GAMMA vs FACT?
FACT(n) gives n! for non-negative integers only. GAMMA is continuous and works on fractions and negatives, but is shifted by one: GAMMA(n) = (n−1)!.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class