GAMMA function
GAMMA returns the gamma function of a number, which extends the factorial to non-whole numbers. For positive whole numbers, GAMMA(n) equals (n-1)!, and zero or negative integers give #NUM!.
Example
Read it as a sentence: find the gamma function value for 5, which gives 24.
A
B
C
D
1
24
2
3
Syntax
GAMMA(number)
-
number(required) - Value at which to evaluate; not zero or a negative integer.
Returns: The gamma function of the number.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=GAMMA(5) | 24 | Working example |
=GAMMA("5") | 24 | Text-number in first arg |
=GAMMA({5,5}) | 24 | Array in first arg (lifts, spills) |
=GAMMA(-1.5) | 2.363271801 | Negative fraction |
=GAMMA(0.5) | 1.772453851 | Half |
=GAMMA("abc") | #VALUE! | Non-numeric text in first arg |
=GAMMA(NA()) | #N/A | Error in first arg |
=GAMMA(0) | #NUM! | Zero |
Watch out for
- Zero and negative integers return #NUM!.
- Large inputs overflow quickly.
Where it works
- Excel
- GAMMA arrived in Excel 2013. Older versions do not have it.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .