---
title: "TEXTAFTER function in Excel: syntax and examples | PracticeExcel"
description: "How to use TEXTAFTER in Excel 365: the domain of an email, a file name after the last slash, or a code after a dash."
canonical_url: "https://practiceexcelonline.com/functions/textafter"
locale: en
meta:
  "og:description": "How to use TEXTAFTER in Excel 365: the domain of an email, a file name after the last slash, or a code after a dash."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVEFGVEVSIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBURVhUQUZURVIgaW4gRXhjZWwgMzY1OiB0aGUgZG9tYWluIG9mIGFuIGVtYWlsLCBhIGZpbGUgbmFtZSBhZnRlciB0aGUgbGFzdCBzbGFzaCwgb3IgYSBjb2RlIGFmdGVyIGEgZGFzaC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVEFGVEVSKHRleHQsIGRlbGltaXRlciwgW2luc3RhbmNlX251bV0sIFttYXRjaF9tb2RlXSwgW21hdGNoX2VuZF0sIFtpZl9ub3RfZm91bmRdKQ%2Cp_Ii9mdW5jdGlvbnMvdGV4dGFmdGVyIg%2Cs_QofSrA1Yc4fGnpok.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "TEXTAFTER function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVEFGVEVSIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBURVhUQUZURVIgaW4gRXhjZWwgMzY1OiB0aGUgZG9tYWluIG9mIGFuIGVtYWlsLCBhIGZpbGUgbmFtZSBhZnRlciB0aGUgbGFzdCBzbGFzaCwgb3IgYSBjb2RlIGFmdGVyIGEgZGFzaC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVEFGVEVSKHRleHQsIGRlbGltaXRlciwgW2luc3RhbmNlX251bV0sIFttYXRjaF9tb2RlXSwgW21hdGNoX2VuZF0sIFtpZl9ub3RfZm91bmRdKQ%2Cp_Ii9mdW5jdGlvbnMvdGV4dGFmdGVyIg%2Cs_QofSrA1Yc4fGnpok.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The TEXTAFTER function**

Returns the text after a delimiter, such as the domain after the @ in an email address. You can choose which occurrence of the delimiter to use.

=

TEXTAFTER(

## **Syntax**

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

<dl><dt>**text **</dt>
<dd>The text to search.</dd>
<dt>**delimiter **</dt>
<dd>The character or text to start after.</dd>
<dt>**instance_num **(optional)</dt>
<dd>Which occurrence to use. 1 or left out for the first, 2 for the second, -1 for the last.</dd>
<dt>**match_mode **(optional)</dt>
<dd>1 to ignore upper and lower case. Left out, 0, which matches case.</dd>
<dt>**match_end **(optional)</dt>
<dd>1 to treat the end of the text as a delimiter. Left out, 0.</dd>
<dt>**if_not_found **(optional)</dt>
<dd>What to return when the delimiter is missing. Left out,</dd></dl>

## **Examples**

C1`=TEXTAFTER(<sup>1</sup>A2,<sup>2</sup>"@")`

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Email |  | **example.com** |
| 2 | ann.berg@example.com |  | |

**In plain words:** Return the text in <sup>1</sup>the email address in A2 that comes <sup>2</sup>after the @.

B1=TEXTAFTER("C:/Reports/2024/sales.xlsx","/",-1)

|  | A | B |
| --- | --- | --- |
| 1 |  | **sales.xlsx** |

B1=TEXTAFTER("Invoice 2024-117","-")

|  | A | B |
| --- | --- | --- |
| 1 |  | **117** |

## **Practice TEXTAFTER**

- [**1****Flip "Last, First" with TEXTAFTER**→](https://practiceexcelonline.com/practice/substitute-textbefore-textafter/textafter-flip-names)
- [**2****Take the text between parentheses**→](https://practiceexcelonline.com/practice/substitute-textbefore-textafter/text-between-parentheses)

## **Questions**

<details>

<summary>

### How do I get the text after the last space or slash?

</summary>

Use -1 as the occurrence, as in =TEXTAFTER(A2,"/",-1). TEXTAFTER then counts from the end of the text.

</details>

<details>

<summary>

### How do I do the same in older versions of Excel?

</summary>

Combine MID or RIGHT with FIND, as in =MID(A2,FIND("@",A2)+1,100), which takes up to 100 characters after the @.

</details>

## **Related functions**

- [**TEXTBEFORE**](https://practiceexcelonline.com/functions/textbefore)
- [**TEXTSPLIT**](https://practiceexcelonline.com/functions/textsplit)
- [**RIGHT**](https://practiceexcelonline.com/functions/right)
- [**MID**](https://practiceexcelonline.com/functions/mid)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/textafter#webpage","description":"How to use TEXTAFTER in Excel 365: the domain of an email, a file name after the last slash, or a code after a dash.","name":"TEXTAFTER function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/textafter","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://practiceexcelonline.com/functions/textafter#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"mainEntity":[{"@id":"https://practiceexcelonline.com/functions/textafter#/schema/question/1"},{"@id":"https://practiceexcelonline.com/functions/textafter#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/textafter"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/textafter#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"TEXTAFTER function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/textafter#article","description":"How to use TEXTAFTER in Excel 365: the domain of an email, a file name after the last slash, or a code after a dash.","headline":"TEXTAFTER function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVEFGVEVSIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBURVhUQUZURVIgaW4gRXhjZWwgMzY1OiB0aGUgZG9tYWluIG9mIGFuIGVtYWlsLCBhIGZpbGUgbmFtZSBhZnRlciB0aGUgbGFzdCBzbGFzaCwgb3IgYSBjb2RlIGFmdGVyIGEgZGFzaC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVEFGVEVSKHRleHQsIGRlbGltaXRlciwgW2luc3RhbmNlX251bV0sIFttYXRjaF9tb2RlXSwgW21hdGNoX2VuZF0sIFtpZl9ub3RfZm91bmRdKQ%2Cp_Ii9mdW5jdGlvbnMvdGV4dGFmdGVyIg%2Cs_QofSrA1Yc4fGnpok.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/textafter#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/textafter#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/functions/textafter#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I get the text after the last space or slash?","acceptedAnswer":{"@type":"Answer","text":"Use -1 as the occurrence, as in =TEXTAFTER(A2,\"/\",-1). TEXTAFTER then counts from the end of the text."}},{"@id":"https://practiceexcelonline.com/functions/textafter#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I do the same in older versions of Excel?","acceptedAnswer":{"@type":"Answer","text":"Combine MID or RIGHT with FIND, as in =MID(A2,FIND(\"@\",A2)+1,100), which takes up to 100 characters after the @."}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVEFGVEVSIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBURVhUQUZURVIgaW4gRXhjZWwgMzY1OiB0aGUgZG9tYWluIG9mIGFuIGVtYWlsLCBhIGZpbGUgbmFtZSBhZnRlciB0aGUgbGFzdCBzbGFzaCwgb3IgYSBjb2RlIGFmdGVyIGEgZGFzaC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVEFGVEVSKHRleHQsIGRlbGltaXRlciwgW2luc3RhbmNlX251bV0sIFttYXRjaF9tb2RlXSwgW21hdGNoX2VuZF0sIFtpZl9ub3RfZm91bmRdKQ%2Cp_Ii9mdW5jdGlvbnMvdGV4dGFmdGVyIg%2Cs_QofSrA1Yc4fGnpok.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVEFGVEVSIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBURVhUQUZURVIgaW4gRXhjZWwgMzY1OiB0aGUgZG9tYWluIG9mIGFuIGVtYWlsLCBhIGZpbGUgbmFtZSBhZnRlciB0aGUgbGFzdCBzbGFzaCwgb3IgYSBjb2RlIGFmdGVyIGEgZGFzaC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVEFGVEVSKHRleHQsIGRlbGltaXRlciwgW2luc3RhbmNlX251bV0sIFttYXRjaF9tb2RlXSwgW21hdGNoX2VuZF0sIFtpZl9ub3RfZm91bmRdKQ%2Cp_Ii9mdW5jdGlvbnMvdGV4dGFmdGVyIg%2Cs_QofSrA1Yc4fGnpok.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
