Excel TEXTAFTER function

Returns the text that comes after a delimiter. In Spanish Excel it is called TEXTODESPUES.

Syntax

English Excel

=TEXTAFTER(text, delimiter, [instance_num])

Spanish Excel (Mexico)

=TEXTODESPUES(texto, delimitador, [núm_instancia])

Spanish Excel (Spain, Latin America)

=TEXTODESPUES(texto; delimitador; [núm_instancia])

ArgumentWhat it is
textThe full text.
delimiterWhat marks the cut.
instance_numoptionalWhich occurrence to use; -1 is the last.

Example

TEXTBEFORE(text, delimiter) returns what comes before the delimiter and TEXTAFTER what comes after it. They replace long combinations of LEFT, FIND and MID. Excel 365 only.

=TEXTAFTER(A2,", ")

Common mistake

With -1 as the instance you get what follows the last occurrence, such as a file extension.

About Ads

This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.

Advertising
Loading ad...

Ads help us keep WebHerramientas free for everyone

Practice TEXTAFTER

Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons

TEXTBEFORE and TEXTAFTER

TEXTBEFORE(text, delimiter) returns what comes before the delimiter and TEXTAFTER what comes after it. They replace long combinations of LEFT, FIND and MID. Excel 365 only.

Step 1/2

In B2, extract the last name: everything before the comma.

B2
ABCD
1Full nameLast nameFirst name
2Hernández, Carmen
3Ortiz, Jorge Luis
4Ramírez, Lucía
5De la Cruz, Andrés
6Vega, Paola
7

Tip: while typing, click a cell or drag across several to insert their reference. F4 anchors the reference with $.

Frequently asked questions

What is TEXTAFTER called in Spanish?
In Spanish Excel it is TEXTODESPUES. The formula =TEXTAFTER(A2,", ") is written =TEXTODESPUES(A2;", ") (or with commas in Mexico).
Why does TEXTAFTER use semicolons in some Excel versions?
It depends on regional settings. Where the comma is the decimal mark (Spain, much of South America), Excel separates arguments with semicolons. English Excel and Mexican Spanish Excel use commas.
What is the most common TEXTAFTER mistake?
With -1 as the instance you get what follows the last occurrence, such as a file extension.