TEXTAFTER Function

Returns the text that comes after a delimiter.

Category

Text

Available in

Microsoft 365, Excel 2024

Returns

Text

Taught hands-on in Level 4: Advanced Dynamic Arrays & Logic - Advanced Math & Text module

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

ArgumentRequired?What it does
textYesThe text to search.
delimiterYesThe character or text to start after.
instance_numOptionalWhich occurrence to use. 1 = first (default); -1 = last.
match_modeOptional1 ignores case. Default 0.
match_endOptional1 treats the end of the text as a delimiter. Default 0.
if_not_foundOptionalWhat 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, "@")
AB
1EmailDomain
2ana.lopez@northstar.comnorthstar.com
3ben@supplyco.netsupplyco.net
4cara@partner.capartner.ca
=TEXTAFTER(A2, "@") Explain

Example 2 — The last word

Last names, even when there's a middle name.

B2fx=TEXTAFTER(A2, " ", -1)
AB
1Full nameLast name
2Ana LopezLopez
3Ben James ChoCho
4Maria de la CruzCruz
=TEXTAFTER(A2, " ", -1) Explain

Common mistakes

  • #N/A when there's no delimiter. Supply if_not_found, for example =TEXTAFTER(A2, "@", , , , "No email").

Notes

Kyle Stott

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.