Text
TEXTAFTER Function in Excel
Returns text that occurs after a specified delimiter.
Syntax
- =TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
Arguments
- text (required): Text to search in
- delimiter (required): Text to search for
- instance_num (optional): Which occurrence (default 1)
- match_mode (optional): 0=case-sensitive, 1=case-insensitive
Examples
- =TEXTAFTER("John Smith", " ") - Get last name - Result: Smith
- =TEXTAFTER("[email protected]", "@") - Get domain - Result: b.com
Excel TEXTAFTER function documentation
- TEXTAFTER returns text after a delimiter — complement to [TEXTBEFORE](/functions/textbefore/).
- Syntax: =TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found]).
- Microsoft 365 — parse domains, file extensions, path segments, and trailing codes.
- Related: [TEXTSPLIT](/functions/textsplit/), [RIGHT](/functions/right/), [FIND](/functions/find/).
TEXTAFTER syntax tips
- instance_num selects which delimiter occurrence to use (negative counts from end in supported modes).
- if_not_found avoids errors when delimiter absent — return blank or custom message.
- match_mode for case sensitivity when delimiter is alphabetic.
- Pair TEXTBEFORE + TEXTAFTER to split without TEXTSPLIT wide spill.
Step-by-step: get domain from email
- Step 1 — Email in A2.
- Step 2 — Domain: =TEXTAFTER(A2, "@").
- Step 3 — Local part: =TEXTBEFORE(A2, "@").
- Step 4 — Missing @: =TEXTAFTER(A2, "@", , , , "Invalid").
- Step 5 — Lower domain: =LOWER(TEXTAFTER(A2, "@")).
TEXTAFTER vs RIGHT vs REGEX
- TEXTAFTER — delimiter based; variable length.
- RIGHT — fixed character count from end.
- REGEXEXTRACT — pattern based in 365.
- Legacy: =RIGHT(A2, LEN(A2)-FIND("@",A2)).
Worked examples to copy
- After dash: =TEXTAFTER(A2, "-").
- File ext: =TEXTAFTER(A2, ".", -1) when supported.
- URL path: =TEXTAFTER(A2, "//", 1) multi-char delimiter.
- Trim: =TRIM(TEXTAFTER(A2, ":")).
People also ask
- TEXTAFTER Excel 2019? — No; 365 / 2021+.
- TEXTAFTER not found? — Supply if_not_found parameter.
- TEXTAFTER vs MID? — TEXTAFTER finds delimiter automatically.
- Combine with TEXTSPLIT? — TEXTSPLIT when you need all parts at once.
Common errors
- #N/A if delimiter not found
Use cases
- Extract domains
- Parse names
- Split data
Frequently asked questions
- How do I extract the file extension from a filename? Use =TEXTAFTER(filename, ".", -1) where -1 gets text after the LAST period. For "report.2024.xlsx", this returns "xlsx". Without -1, it would return "2024.xlsx" (after first period).
- How do I handle cases where the delimiter might not exist? Use the if_not_found parameter: =TEXTAFTER(A1, "@", 1, 0, 0, "No @ found"). If @ doesn't exist, it returns your custom message instead of #N/A error. Or wrap in IFERROR.
- Is TEXTAFTER available in older Excel versions? TEXTAFTER is only available in Excel 365 and Excel 2021. For older versions, use =MID(A1, FIND(delimiter, A1)+LEN(delimiter), 999) or RIGHT/FIND combinations to achieve similar results.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.
When to use TEXTAFTER
- Extract domains — common Text scenario for TEXTAFTER.
- Parse names — common Text scenario for TEXTAFTER.
- Split data — common Text scenario for TEXTAFTER.
TEXTAFTER in the Text category
- Browse all Text functions at /categories/text/ for related formulas.
- TEXTAFTER syntax: =TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
- text (required): Text to search in
- delimiter (required): Text to search for
- instance_num (optional): Which occurrence (default 1)
- match_mode (optional): 0=case-sensitive, 1=case-insensitive
- Confirm TEXTAFTER arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
Formula checklist before you copy down
- Confirm TEXTAFTER arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
- If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
- Spot-check three known input rows manually against expected output.
Related Excel functions
- TEXTBEFORE (/functions/textbefore/): Returns text that occurs before a specified delimiter.
- TEXTSPLIT (/functions/textsplit/): Splits text into rows or columns using delimiters.
- MID (/functions/mid/): Returns a specific number of characters from a text string, starting at a specified position.
- RIGHT (/functions/right/): Returns the specified number of characters from the end of a text string.
Comparisons involving this function
- LEFT vs MID vs RIGHT (/compare/left-vs-mid-vs-right/): Use LEFT, MID, and RIGHT for fixed-position extraction. Use TEXTBEFORE, TEXTAFTER, and TEXTSPLIT in modern Excel when values are separated by a delimiter.
Errors to watch for
- #N/A if delimiter not found — review causes on linked error pages in the directory.
Copy-paste audit workflow
- Enter TEXTAFTER on three test rows with known expected output documented on a QA tab.
- Fill down only after absolute references are locked on lookup tables and rate tables.
- Compare against manual calculation or a calculator for financial and statistical functions.
- Search this directory for comparison guides when choosing between similar functions in the same category.
TEXTAFTER worked examples to copy
- =TEXTAFTER("John Smith", " ") — Get last name. Expected result: Smith.
- =TEXTAFTER("[email protected]", "@") — Get domain. Expected result: b.com.
TEXTAFTER reference summary for crawlers and offline review
- TEXTAFTER belongs to the Text category in Excel. Returns text that occurs after a specified delimiter.
- Full syntax: =TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found]). Open /functions/textafter/ for parameters, FAQs, and related pages.
- Common mistakes: #N/A if delimiter not found
- Pair this function with comparison guides when another Excel formula might fit the same task better.
- Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.