# Documentation/Calc Functions/GAMMA.DIST

TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate

## Function name:

GAMMA.DIST

## Category:

Statistical Analysis

## Summary:

Calculates the value of the probability density function or the cumulative distribution function for the gamma distribution.

## Syntax:

GAMMA.DIST(**Number**; **Alpha**; **Beta**; **C**)

## Returns:

Returns a real number which is a value of the probability density function or the cumulative distribution function for the Gamma distribution. Its value ranges from 0 to 1, i.e. [0,1].

## Arguments:

**Number** is a real number or a reference to the cell containing that number for which the gamma distribution is to be calculated.

**Alpha** is a real number or a reference to the cell containing that number which is the alpha (shape) parameter for the gamma distribution.

**Beta** is a real number or a reference to the cell containing that number which is the beta (rate) parameter for the gamma distribution.

**C** can be 0 or False to calculate the probability density function. It can be any other value or True to calculate the cumulative distribution function.

- If either of
**Alpha**or**Beta**is negative or zero then the function returns an error value. - If
**Number**is negative then the function returns an error value.

## Additional details:

- The formula for GAMMA.DIST is:

If **C** is FALSE(), GAMMA.DIST returns 0 if x=0, an error value if x<0 and the probability density function value

If **C** is TRUE(), GAMMA.DIST returns 0 if x=0, an error value if x<0 and the cumulative distribution function value

- For more details on gamma distribution, visit Wikipedia.

## Examples:

Formula | Description | Returns |
---|---|---|

=GAMMA.DIST(4,3.4,4.5,0) | The function calculates the probability density function for the gamma distribution with Number as 4, Alpha as 3.4 and Beta as 4.5 . |
0.023098822632503 |

=GAMMA.DIST(4,3.4,4.5,1) | The function calculates the cumulative distribution function for the gamma distribution with Number as 4, Alpha as 3.4 and Beta as 4.5 . |
0.023098822632503 |

=GAMMA.DIST(0,3.4,4.5,1) | The function returns 0 for Number equal to 0, given all arguments are valid. |
0 |

=GAMMA.DIST(-4,3.4,4.5,1) | The Number is negative hence the function returns an error value. |
Err:502 |

## Related LibreOffice functions:

## ODF standard:

None

## Equivalent Excel functions:

GAMMA.DIST