TEXTAFTER in Excel: what it does and how to use it

TEXTAFTER returns everything that follows a marker you name. Give it an at sign and it returns the domain; give it a space and it returns the surname.

Syntax

TEXTAFTER(text, delimiter, [instance_num])

text
The value to cut up, usually a cell reference.
delimiter
The marker to start after, in quotes. An at sign is "@", a space is " ".
instance_num
Which occurrence of that marker to start after. Left out it means the first. TEXTAFTER("a-b-c","-",2) returns c. A negative number counts back from the end, which is the neat way to take the last part of a name.

When to use it

Pulling the second half out of a value that has two halves: the domain from an email address, the surname from a full name, the unit from a measurement.

What trips people up

It needs Microsoft 365. Before that the job was done by MID with FIND, which works everywhere but is harder to read and easy to be off by one character.

Watch it built, step by step

Questions

How do I get the text after the last space?

=TEXTAFTER(A2," ",-1). With a full name in A2, that returns the surname even when there is a middle name.

Can I split on more than one character?

Yes. Give it a list of delimiters: =TEXTAFTER(A2,{"-","/"}) splits on whichever comes first.

What can I use in older versions of Excel?

=MID(A2,FIND("@",A2)+1,LEN(A2)) returns everything after the @ in any version.

Related functions

Settings: separator, Excel version

Argument separator

Set by your computer's language, not by the file. A frequent cause of a correct-looking formula being rejected.

Excel version

XLOOKUP, IFS, TEXTBEFORE and TEXTJOIN need Microsoft 365 or 2021; older versions return #NAME? instead. Choosing the older one switches every walkthrough to a formula that works there.