# Documentation/Calc Functions/GAMMADIST

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

## Function name:

GAMMADIST

## Category:

Statistical Analysis

## Summary:

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

## Syntax:

GAMMADIST(**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. By default, its value is 0.

- 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 GAMMADIST is:

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

If **C** is TRUE(), GAMMADIST 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 |
---|---|---|

=GAMMADIST(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 |

=GAMMADIST(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.033711040932054 |

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

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

## Related LibreOffice functions:

## ODF standard:

## Equivalent Excel functions:

GAMMADIST