# COLUMNS Function

> Count the columns of a range or array constant with the COLUMNS formula function of TX Sheet Control: the required reference argument and examples.

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

---

Return the number of columns in a reference or array. `reference` is a cell, a range or an array constant: `COLUMNS(C1:E4)` returns 3, and `COLUMNS({1,2,3;4,5,6})` returns 3. The argument is required; without it, COLUMNS returns `#VALUE!`.

### Syntax

```text
COLUMNS(reference)
```

Category: Lookup. Minimum arguments: 0. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=COLUMNS(A5)
```

The formula returns 1, because the reference is a single cell.

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:** [COLUMN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/column/llms-full.txt)
- **Next:** [COMBIN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/combin/llms-full.txt)
