Excel - GAMMADIST Function



GAMMADIST Function

The Excel GAMMADIST function returns the gamma distribution. It is considered a continuous probability distribution to study variables that may have a skewed distribution, to analyze the variation in cancer rates. The gamma distribution is commonly used in queuing analysis and weather forecasting. The Gamma distribution would model the elapsed time among certain events.

The GAMMADIST function replaces the GAMMA.DIST function in Excel 2010.

Compatibility

This advanced Excel function is compatible with the following versions of MS-Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2019 for Mac

Syntax

The syntax of GAMMADIST function is as follows −

GAMMADIST(x,alpha,beta,cumulative)

Arguments

You can use the following arguments with the GAMMADIST function −

Argument Description Required / Optional
X You can specify the value to evaluate the distribution. Required
Alpha A shape parameter whose formula is (mean)^2/variance. Required
Beta

A scale parameter whose calculating formula is (variance)/mean to the distribution.

GAMMADIST function retrieves the standard gamma distribution if the value of this parameter is equal to zero.

Required
Cumulative

If this parameter specifies TRUE, this function retrieves the cumulative distribution function.

Otherwise, it will retrieve the probability density function for the FALSE value.

Required

Points to Remember

  • GAMMADIST retrieves the if the alpha value equals half of x, the beta equals two, the cumulative argument equals True, and x specifies the positive values.
  • For non-numeric arguments, GAMMADIST retrieves the #VALUE! error value.
  • GAMMADIST will retrieve the #NUM! error if the x value is less than zero.
  • Either alpha 0 or beta 0, GAMMADIST retrieves the #NUM! error value.
  • GAMMADIST is considered an Erlang distribution for integer alpha whose value is greater than zero.
  • The GAMMADIST function will retrieve the exponential distribution if the alpha value equals one.

Examples of GAMMADIST Function

Practice the following examples to learn the use of the GAMMADIST function in Excel.

Example 1

GAMMADIST retrieves the if the alpha value equals half of x, the beta equals two, the cumulative argument equals True, and x specifies the positive values.

Solution

Enter the input data in the desired worksheet as shown below −

  • x = 6
  • Alpha = 3
  • Beta = 2
  • Cumulative = True
  • Now enter the formula =GAMMADIST(C2,C3,C4,C5) in the C6 cell and press the Enter button.
  • Therefore, the Gamma distribution value is 0.80.
Excel GAMMADIST Function 1

Excel GAMMADIST Function 2

Let's verify this resulting value along with the Chi distribution formula. You can enter the formula =(1-CHISQ.DIST.RT(6,C2)) in the E6 cell and press Enter. Here, C2 represents the degree of freedom.

Excel GAMMADIST Function 3

Excel GAMMADIST Function 4

Therefore, you can notice in the screenshot that the C6 and E6 cell values are the same.

Example 2

How to model new cancer cases rate through Gamma distribution.

Solution

Assume a sample dataset comprises two columns Cancer Type and "Rate of latest cancer cases" in the 2024 year.

Excel GAMMADIST Function 5

Now enter the formula "=AVERAGE(B2:B6)" in the D2 cell to evaluate the mean "rate of latest cancer cases" column.

Excel GAMMADIST Function 6

Furthermore, you may calculate the variance of the B column. Enter the formula =VAR.S(B2:B6) in the D3 cell.

Excel GAMMADIST Function 7

You may calculate the value of Alpha by entering the formula =(D2^2)/D3 in the D4 cell and by pressing the Enter tab.

Excel GAMMADIST Function 8

Similarly, to calculate the Beta parameter, enter the formula "=D3/D2" in the D5 cell.

Excel GAMMADIST Function 9

Finally, you can calculate the gamma distribution. Enter the formula "=GAMMADIST(D2,D4,D5,TRUE)" in the B7 cell. The resulting value of the gamma distribution that retrieves the cumulative distribution function is 0.6042.

Excel GAMMADIST Function 10

If Gamma Distribution retrieves the probability density function, in this case, you need to alter the formula "=GAMMADIST(D2, D4, D5, FALSE)" in the B7 cell. The resulting value is 2.25918.

Excel GAMMADIST Function 11

Example 3

For non-numeric arguments, GAMMADIST retrieves the #VALUE! error value.

Solution

In this example, the input data corresponding to the Alpha parameter is text. Enter the formula =GAMMADIST(C2,C3,C4,C5) in the C6 cell and press the Enter tab.

Excel GAMMADIST Function 12

Excel GAMMADIST Function 13

Example 4

Either alpha 0 or beta 0, GAMMADIST retrieves the #NUM! error value.

Solution

In this example, the value of the Beta parameter is negative -33. Now, you may enter the formula =GAMMADIST(C2,C3,C4,C5) in the C6 cell and press the Enter.

Excel GAMMADIST Function 14

Excel GAMMADIST Function 15

Therefore, the #NUM! error occurs if any of the parametric values inside the Gamma distribution formula are negative.

Example 5

The GAMMADIST function will retrieve the exponential distribution if the alpha value equals one.

Solution

In this example, the alpha value is one, and write the formula = =GAMMADIST(C2,C3,C4,C5) in the C6 cell and press the Enter tab.

Excel GAMMADIST Function 16

Therefore, in this example, the Gamma distribution function became the exponential distribution. You may cross verify its value by executing the EXPODIST function in the desired cell.

Advertisements