# GCD Function

> Return the greatest common divisor of integers with the GCD formula function of TX Sheet Control: arrays, truncated decimals, #NUM! and #VALUE! errors.

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

---

Return the greatest common divisor of integers, the largest integer that divides all of them without a remainder. `number1`, `number2` and up to 255 numbers or arrays are the values; decimals are truncated to integers. A negative number returns `#NUM!`, and text that is not a number returns `#VALUE!`.

### Syntax

```text
GCD(number1, number2)
```

Category: Math. Minimum arguments: 1. Maximum arguments: 255.

Available for supported offline calculation.

### Examples

```text
=GCD(12,18)
```

The formula returns 6.

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:** [GAUSS Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/gauss/llms-full.txt)
- **Next:** [GEOMEAN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/geomean/llms-full.txt)
