The gamma function, denoted Γ(x), is commonly employed in a number of statistical distributions. Click here if you are interested in a formal definition which involves calculus, but for our purposes this is not necessary. What is important are the following properties and the fact that Excel provides a function that computes the gamma function (as described below).
- Γ(1) = 1
- Γ(x + 1) = x Γ(x)
- Γ(n) = (n – 1)! For all natural numbers n = 0, 1, 2, 3, …
- Γ(½) =
Excel Function: Excel provides the following function:
GAMMALN(x) = ln Γ(x), i.e. the natural log of the gamma function. Since the inverse of the log function is the exponential function (for more details see Exponentials and Logs and Built-in Excel Functions, and so the gamma function can be expressed by the formula:
Γ(x) = EXP(GAMMALN(x))
Alternatively the gamma function can be calculated from Excel’s function for the gamma distribution (see Gamma Distribution) as follows:
Γ(x) = EXP(-1) / GAMMADIST(1, x, 1, FALSE)
Excel 2010/2013 also provide the function GAMMALN.PRECISE, which is equivalent to GAMMALN. Excel 2013 provides the function GAMMA, where GAMMA(x) = Γ(x).