# LCM Function

> Calculate the least common multiple of up to 255 integers with the LCM formula function of TX Sheet Control: truncated decimals, zero and the #NUM! error.

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

---

Return the least common multiple of integers. `number1`, `number2` and further arguments, up to 255, are truncated to integers first. A negative number returns `#NUM!`, and 0 returns 0.

### Syntax

```text
LCM(number1, number2)
```

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

Available for supported offline calculation.

### Examples

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

The formula returns 36, the smallest number that both 12 and 18 divide.

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:** [LARGE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/large/llms-full.txt)
- **Next:** [LEFT Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/left/llms-full.txt)
