Excel Function

Excel TEXTAFTER function

Extract everything after a specific character or word — no FIND, no MID, no nesting.

TEXTAFTER returns the text that appears after a specified delimiter. It is the companion to TEXTBEFORE and replaces the old MID + FIND approach for splitting text.

Syntax

TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
ArgumentWhat it means
text requiredThe text string to extract from.
delimiter requiredThe character or string to search for.
instance_num optionalWhich occurrence to use. Default is 1 (first). Use -1 for the last occurrence.
match_mode optional0 = case-sensitive (default), 1 = case-insensitive.
if_not_found optionalWhat to return if delimiter isn't found. Defaults to #N/A.

Examples

Extract last name from full name

=TEXTAFTER(A2, " ")

If A2 contains "Sarah Johnson", this returns "Johnson".

Extract domain from email address

=TEXTAFTER(A2, "@")

If A2 contains "sarah@example.com", this returns "example.com".

Extract file extension

=TEXTAFTER(A2, ".", -1)

Using -1 finds the last dot, so "report.Q2.2026.xlsx" correctly returns "xlsx", not "Q2".

Combine TEXTBEFORE and TEXTAFTER to extract the middle

Extract the city from "12 Oak Street, Birmingham, UK":

=TEXTBEFORE(TEXTAFTER(A2, ", "), ", ")

TEXTAFTER strips everything up to and including the first comma-space, then TEXTBEFORE strips everything from the second comma-space onward.

What if the delimiter appears multiple times?
By default, TEXTAFTER matches the first occurrence. Set instance_num to 2 for the second, 3 for the third, or -1 for the last.
What version of Excel supports TEXTAFTER?
Excel 365 and Excel for the web only. Not available in Excel 2021, 2019, or earlier.

Practice TEXTAFTER for real

Type it in a live spreadsheet, get instant feedback. No videos, no downloads.

Start practising free →