# TRIM Function

> Remove leading, trailing and repeated spaces from text with the TRIM formula function of TX Sheet Control: which characters it removes and an example.

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

---

Remove extra ordinary spaces from text. TRIM removes the spaces at the beginning and the end of `text` and reduces every run of spaces between words to one space. Only the ordinary space character is removed: nonbreaking spaces (`CHAR(160)`) and tabs stay in the text.

### Syntax

```text
TRIM(text)
```

Category: Text. Minimum arguments: 1. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=TRIM("  TX   Sheet   Control  ")
```

The formula returns "TX Sheet Control".

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:** [TREND Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trend/llms-full.txt)
- **Next:** [TRIMMEAN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trimmean/llms-full.txt)
