Spreadsheet Practice

TEXTAFTER function

TEXTAFTER returns everything after a delimiter, such as the domain after the @ or the last part of a file path. Set instance_num to -1 to split at the last delimiter, which handles file names and last names cleanly.

Available in
Excel 2024 and Microsoft 365
Category
Text functions
Returns
The text after the chosen delimiter.

Syntax

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

ArgumentRequired?What it is
textRequiredThe text or cell to split.
delimiterRequiredThe character or text to split at.
instance_numOptionalWhich delimiter to use: 1 for the first (default), 2 for the second, -1 for the last.
match_modeOptional0 for a case-sensitive match (default), 1 to ignore case.
match_endOptional1 treats the end of the text as a delimiter. The default is 0.
if_not_foundOptionalWhat to return when the delimiter isn't there, instead of #N/A.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
D2=TEXTAFTER(A2,"@")acme.comThe domain after the @
D3=TEXTAFTER(B3,"/",-1)budget.csvThe file name after the last slash
D4=TEXTAFTER(C4," - ",,,,"Pending")PendingNo status yet, so if_not_found fills in

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
EmailPathOrder noteResult
maya.chen@acme.comC:/reports/2026/q3.xlsxOrder 1042 - Shippedacme.com
raj@globex.ioD:/archive/budget.csvOrder 1043 - Backorderbudget.csv
lee.wong@initech.netE:/notes/today.txtOrder 1044Pending

Practice TEXTAFTER

From lesson 16, TEXTBEFORE, TEXTAFTER & FIND. Graded instantly, then re-checked on changed data.

Domain

In C2, return everything after the @. Fill down to C6.

Common mistakes

What you seeWhy, and how to fix it
#N/AThe delimiter isn't in the text. Add an if_not_found value as the sixth argument.
#NAME?TEXTAFTER is only in Excel 2024 and Microsoft 365. In older versions, use =MID(A2,FIND("@",A2)+1,LEN(A2)).
You get the middle instead of the endTEXTAFTER splits at the first delimiter by default. Use -1 as instance_num to split at the last one.

Tips

  • Get a file extension even when the name has other dots: =TEXTAFTER(A2,".",-1).

Questions

How do I get the text after a character in Excel?

In Excel 2024 or Microsoft 365, use =TEXTAFTER(A2,"@"). In older versions, use =MID(A2,FIND("@",A2)+1,LEN(A2)).

How do I get the last word in a cell?

=TEXTAFTER(A2," ",-1) returns everything after the last space.

Lessons that use TEXTAFTER

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.