# MID Function

> Extract characters from the middle of a text with the MID formula function of TX Sheet Control: 1-based start position, length, text end and #VALUE! errors.

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

---

Extract characters from the middle of a text, using a 1-based start position. `text` is the text, `start_num` the position of the first character to extract and `num_chars` the number of characters. A start position after the end of the text returns empty text, and a `num_chars` that reaches past the end returns the rest of the text. A `start_num` less than 1 or a negative `num_chars` returns `#VALUE!`.

### Syntax

```text
MID(text, start_num, num_chars)
```

Category: Text. Minimum arguments: 3. Maximum arguments: 3.

Available for supported offline calculation.

### Examples

```text
=MID("Spreadsheet",7,5)
```

The formula returns `sheet`, the five characters from position 7 of `Spreadsheet`.

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:** [MEDIAN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/median/llms-full.txt)
- **Next:** [MIDB Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/midb/llms-full.txt)
