What it does
TEXTAFTER replaces the formula you would otherwise build from RIGHT, LEN and FIND: it looks for the delimiter and returns everything after it. =TEXTAFTER("sales@northgate.com","@") returns "northgate.com".
Its handiest feature is finding the last delimiter directly: with -1 as the third argument it counts from the end. That gets the extension from a file name with several dots, such as "report.oct.xlsx", or the suffix from "KBL-1525-SY", in one formula. If the delimiter is missing the result is #N/A, and the last argument lets you return something else instead.
TEXTAFTER exists only in Microsoft 365, Excel 2024 and Excel for the web. For the part before the delimiter use TEXTBEFORE, and to split the text at every delimiter use TEXTSPLIT.
Syntax
=TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])=SONRAKİMETİN(metin; sınırlayıcı; [kaçıncı]; [eşleştirme_modu]; [eşleştirme_sonu]; [bulunamazsa])Arguments in square brackets are optional. English Excel separates arguments with commas (,) and uses a dot for decimals; Turkish Excel uses semicolons (;) and a decimal comma. Excel shows function names in its own language when it opens the file.
Arguments
| Argument | Required | Description |
|---|---|---|
text | Required | The text, or cell, to search. |
delimiter | Required | The delimiter after which the text is returned; one or more characters. |
instance_num | Optional | Which occurrence to use; 1 if omitted. Negative numbers count from the end: -1 is the last delimiter. It cannot be 0. |
match_mode | Optional | 0 (default): case-sensitive. 1: case is ignored. |
match_end | Optional | 0 (default): the end of the text is not a delimiter. 1: the end counts as one, so the result is empty text when the delimiter is missing. |
if_not_found | Optional | The value to return when the delimiter is not found. If omitted, the result is #N/A. |
Examples
1Take the text after the first and the last hyphen
Column B returns everything after the first hyphen; column C uses -1 to take only the colour suffix after the last one.
=TEXTAFTER(A2,"-")| A | B | C | |
|---|---|---|---|
| 1 | Product Code | Code without Group | Colour Suffix |
| 2 | KBL-1525-SY | 1525-SY | SY |
| 3 | PRZ-21-BY | 21-BY | BY |
| 4 | SGT-0016-C | 0016-C | C |
| 5 | KNL-120-GR | 120-GR | GR |
- B2 (filled down to B5)
=TEXTAFTER(A2,"-") - C2 (filled down to C5)
=TEXTAFTER(A2,"-",-1)
The first row returns 1525-SY and SY; the third returns 0016-C and C.
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
2Get the extension from a file name
Some file names contain several dots. -1 picks the last dot, so every row returns only the extension.
=TEXTAFTER(A2,".",-1)| A | B | |
|---|---|---|
| 1 | File Name | Extension |
| 2 | report.oct.xlsx | xlsx |
| 3 | invoice_INV-2025-0042.pdf | |
| 4 | quote.v2.docx | docx |
| 5 | stock.csv | csv |
- B2 (filled down to B5)
=TEXTAFTER(A2,".",-1)
B2 shows xlsx and B4 shows docx. Without the third argument, the first row would return "oct.xlsx".
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
3Return a default when no colour is given
The colour follows " - "; products without a colour come in the standard colour. The last argument returns "Standard" on rows without the delimiter.
=TEXTAFTER(A2," - ",1,0,0,"Standard")| A | B | |
|---|---|---|
| 1 | Description | Colour |
| 2 | Grounded socket - White | White |
| 3 | Circuit breaker | Standard |
| 4 | Cable duct - Grey | Grey |
| 5 | Light switch - Anthracite | Anthracite |
- B2 (filled down to B5)
=TEXTAFTER(A2," - ",1,0,0,"Standard")
B2 shows White, and B3, which has no colour, shows Standard.
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
Common errors and fixes
- #N/A
Cause: The delimiter is not in the text, or it does not appear as many times as requested.
Fix: Give the last argument a value:
=TEXTAFTER(A2," - ",1,0,0,"Standard").- #VALUE!
Cause: instance_num is 0 or larger than the length of the text.
Fix: Use 1, 2… or -1, -2… to count from the end.
- #NAME?
Cause: The file was opened in an older version of Excel that does not know TEXTAFTER.
Fix: In older versions,
=RIGHT(A2,LEN(A2)-FIND("@",A2))does the same job.
Good to know
- To get the last word, use a space as the delimiter and -1 as instance_num:
=TEXTAFTER(A2," ",-1). - The result is text; to calculate with the digits after the delimiter, convert it with
--.
In Nexell
Get Nexell to do it from a sentence
Put the colour suffix after the last hyphen of each product code into a new Colour column
Convert to tableBring your product list into the tool and type this. Nexell builds the Colour column with a real Excel text formula and shows it in the preview first; the formula stays live in the downloaded file.
Nexell uses AI to understand the request and builds the result with real Excel formulas; the formula may differ from the example on this page. You see a preview first and nothing changes until you press Apply; formulas stay live in the downloaded .xlsx file.
Free account · no card needed · 30 credits a month
Frequently asked questions
How do I get the text after the last dot in Excel?
In Microsoft 365, use =TEXTAFTER(A2,".",-1). For "report.oct.xlsx" the result is "xlsx"; the other dots in the name are ignored.
What is the difference between TEXTAFTER and RIGHT?
RIGHT needs to know how many characters to take from the end. TEXTAFTER looks for the delimiter instead, so no counting is needed, and you can set a value for when it is not found.