# TEXTBEFORE Function

> Return the text before a delimiter with TEXTBEFORE in TX Sheet Control: instance number, search from the end, case-insensitive match, if_not_found.

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

---

Return the text before a delimiter. `text` is searched for `delimiter`. `instance_num` selects the occurrence (1 when omitted), counted from the end when it is negative; `match_mode` 1 makes the search case-insensitive, and `match_end` 1 treats the end of the text as a delimiter. When the delimiter isn't found, TEXTBEFORE returns `if_not_found`, or `#N/A` when that is omitted.

### Syntax

```text
TEXTBEFORE(text, delimiter, instance_num, match_mode, match_end, if_not_found)
```

Category: Text. Minimum arguments: 2. Maximum arguments: 6.

Available for supported offline calculation.

### Examples

```text
=TEXTBEFORE("a/b/c","/",2)
```

The formula returns a/b, the text before the second slash.

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:** [TEXTAFTER Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/textafter/llms-full.txt)
- **Next:** [TEXTJOIN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/textjoin/llms-full.txt)
