GAMMA Function

Excel Functions › Statistical

Excel 2013+ Statistical

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)!.


Quick answer:
=GAMMA(5) = 24, because (5-1)! = 4! = 24

Syntax

=GAMMA(number)
ArgumentDescription
numberRequiredThe 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:

=GAMMA(5) // (5-1)! = 4! = 24
=GAMMA(0.5) // = sqrt(pi) = ~1.7725

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

Live demo

Pick a GAMMA example to see the formula and its result.

Result:

Practice workbook

📊
Download the free GAMMA practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

How does GAMMA relate to the factorial?
For a positive integer n, 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?
Because Γ(1/2) equals the square root of π — about 1.77245. This is a classic result that shows the gamma function is defined for non-integer values, not just whole numbers.
When does GAMMA return an error?
At zero and at negative integers (−1, −2, …), where the gamma function has poles — these return #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

Related functions: GAMMALN · GAMMALN.PRECISE · GAMMA.DIST · GAMMA.INV · FACT