TEXTAFTER Function
Returns the text that comes after a delimiter.
Category
Text
Available in
Microsoft 365, Excel 2024
Returns
Text
Overview
TEXTAFTER returns everything after a character or word — the domain after the @, the last name after the space.
With a negative instance number it counts from the end, which makes “the last word” a one-step formula.
Syntax
=TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
Arguments
| Argument | Required? | What it does |
|---|---|---|
| text | Yes | The text to search. |
| delimiter | Yes | The character or text to start after. |
| instance_num | Optional | Which occurrence to use. 1 = first (default); -1 = last. |
| match_mode | Optional | 1 ignores case. Default 0. |
| match_end | Optional | 1 treats the end of the text as a delimiter. Default 0. |
| if_not_found | Optional | What to return when the delimiter isn't found. Default #N/A. |
Examples
Example 1 — Email domains
Which companies are these contacts from?
B2fx=TEXTAFTER(A2, "@")
| A | B | |
|---|---|---|
| 1 | Domain | |
| 2 | ana.lopez@northstar.com | northstar.com |
| 3 | ben@supplyco.net | supplyco.net |
| 4 | cara@partner.ca | partner.ca |
=TEXTAFTER(A2, "@") Explain
Example 2 — The last word
Last names, even when there's a middle name.
B2fx=TEXTAFTER(A2, " ", -1)
| A | B | |
|---|---|---|
| 1 | Full name | Last name |
| 2 | Ana Lopez | Lopez |
| 3 | Ben James Cho | Cho |
| 4 | Maria de la Cruz | Cruz |
=TEXTAFTER(A2, " ", -1) Explain
Common mistakes
- #N/A when there's no delimiter. Supply if_not_found, for example =TEXTAFTER(A2, "@", , , , "No email").
Notes
- Related functions: TEXTBEFORE, TEXTSPLIT, RIGHT.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.