# TRIMRANGE Function

> Remove blank leading and trailing rows and columns from a range with TRIMRANGE in TX Sheet Control: the trim_rows and trim_cols modes and #VALUE! errors.

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

---

Return a range without its blank leading and trailing rows and columns. `range` is the range to trim. `trim_rows` and `trim_cols` select what is removed: 0 nothing, 1 leading blanks, 2 trailing blanks and 3 both (the default). Any other value returns `#VALUE!`. Blank rows and columns inside the data stay.

### Syntax

```text
TRIMRANGE(range, trim_rows, trim_cols)
```

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

Available for supported offline calculation.

### Examples

```text
=TRIMRANGE(A1:C5)
```

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