# GAMMA Function

> Return the value of the gamma function with the GAMMA formula function of TX Sheet Control: the factorial relation, #NUM! errors and floating-point results.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > GAMMA Function
- **210 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/gamma/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/gamma/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/gamma/llms-full.txt

---

Return the value of the gamma function. For a positive integer n, GAMMA(n) equals the factorial (n-1)!. `number` can be any number except 0 and the negative integers, which return `#NUM!`; a `number` greater than about 171.6 also returns `#NUM!`, because the result is too large.

### Syntax

```text
GAMMA(number)
```

Category: Statistics. Minimum arguments: 1. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=GAMMA(5)
```

The formula returns 23.99999999999996, which displays as 24, the factorial 4!. Compare the result with a tolerance rather than for exact equality.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [FVSCHEDULE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/fvschedule/llms-full.txt)
- **Next:** [GAMMA.DIST Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/gamma-dist/llms-full.txt)
