GAMMA Function
Returns the gamma function value — a factorial that works for any number.
Category
Statistical
Available in
Excel 2013+, Microsoft 365
Returns
A number
Want to practice GAMMA in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
For whole numbers, GAMMA(n) = (n − 1)!, so GAMMA(5) = 4! = 24. It also works between whole numbers (GAMMA(0.5) = √π) and for negative non-whole numbers.
It appears inside the formulas for many distributions — gamma, beta, t, chi-square and F.
Syntax
=GAMMA(number) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| number | Yes | Any number except 0 and negative whole numbers. |
Examples
Example 1 — Factorials and beyond
Whole numbers give factorials; other values fill in between.
B2fx=GAMMA(5)
| A | B | |
|---|---|---|
| 1 | Formula | Result |
| 2 | GAMMA(5) | 24 |
| 3 | FACT(4) | 24 |
| 4 | GAMMA(2.5) | 1.3293 |
| 5 | GAMMA(0.5) | 1.7725 |
=GAMMA(5) Explain
GAMMA(0.5) is √π ≈ 1.7725.
Common mistakes
- #NUM! number is 0 or a negative whole number, or the result is too large (above about 171).
- Off by one. GAMMA(n) is (n − 1)!, not n!.
Notes
- For large numbers use GAMMALN, which doesn't overflow.
- Related functions: GAMMALN, FACT, GAMMA.DIST.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.