Skip to content

Excel function · Changing text

TEXTAFTER

Returns the text after a given separator.

What it does

TEXTAFTER returns everything after a separator. Together with TEXTBEFORE it splits a text into two parts without counting characters.

Syntax

=TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])

Arguments in square brackets are optional, and … means you can add more of the same. In this Excel language, arguments are separated by ,

Arguments

text
The text to take the part from.
delimiter
The separator to look for, in quotes.
instance_num
Which occurrence of the separator to use. 1 (the default) is the first; -1 is the last.
match_mode
0 (the default) is case-sensitive; 1 ignores case.
match_end
1 treats the end of the text as a separator. Leave it out in most cases.
if_not_found
What to return when the separator isn't there, instead of #N/A.

Example

Which domain does this email address belong to?

AB
1EmailDomain
2ana.ruiz@example.comexample.com

The formula in B2:

=TEXTAFTER(A2,"@")

Result: example.com

Everything after the @ in ana.ruiz@example.com is example.com.

Common mistakes

  • Taking the part after the first separator when you meant the last one, as with file extensions such as report.v2.pdf. Use -1 as the instance number.
  • Not handling a missing separator, which gives #N/A.

In other Excel languages

Excel translates function names, and in some languages the argument separator too. Type the name your Excel shows.

Excel languageFunction nameSeparator
EnglishTEXTAFTER,
DeutschTEXTNACH;
FrançaisNot confirmed yet;
Español (España)TEXTODESPUES;
Español (México)TEXTODESPUES,
日本語TEXTAFTER,
한국어TEXTAFTER,
繁體中文TEXTAFTER,
ไทยTEXTAFTER,
ខ្មែរTEXTAFTER,
Tiếng ViệtTEXTAFTER;

Practise it

More from this module

All functions