# TEXTBEFORE, TEXTAFTER & FIND (Excel lesson 21 of 45)

> Split text at a delimiter without counting characters.

Source: https://spreadsheetpractice.com/learn/textbefore-textafter-find · Updated October 29, 2026

- **Course:** [Excel course](https://spreadsheetpractice.com/learn), track "Text cleanup"
- **Time:** about 8 minutes, 3 graded exercises
- **Functions:** `TEXTBEFORE`, `TEXTAFTER`, `FIND`
- **Access:** Pro (the lesson text is free; the graded exercises need Pro)
- **Key formula:** `=TEXTBEFORE(A2,"@")`: Everything before @

## How it works

`TEXTBEFORE(text, delimiter)` and `TEXTAFTER(text, delimiter)` split text at a character like @ or a dash, wherever it falls.

In older Excel, combine `FIND`, which returns the position of a character, with LEFT or MID. FIND is case-sensitive; SEARCH is not.

## Syntax

| Formula | What it does |
|---|---|
| `=TEXTBEFORE(A2,"@")` | Everything before @ |
| `=TEXTAFTER(A2,"@")` | Everything after @ |
| `=LEFT(A2,FIND("@",A2)-1)` | Classic version |

## Watch out for

- FIND returns the position of the @ itself, so subtract 1 to stop before it.
- TEXTBEFORE and TEXTAFTER need Microsoft 365.

## The exercises

Solve them in the live grid at [TEXTBEFORE, TEXTAFTER & FIND](https://spreadsheetpractice.com/learn/textbefore-textafter-find). Each answer is graded, then re-checked on changed data so typed-in numbers don't pass.

1. **Username.** In B2, return everything before the @. Fill down to B6.
2. **Domain.** In C2, return everything after the @. Fill down to C6.
3. **The classic way.** In D2, extract the username again using LEFT and FIND, the method that works in every Excel version. Fill down to D6.

Previous: [Cleaning messy data](https://spreadsheetpractice.com/learn/cleaning-messy-data) · Next: [Splitting and counting list cells](https://spreadsheetpractice.com/learn/textsplit-count-clean-lists)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
