# TEXTAFTER function in Excel

> TEXTAFTER returns everything after a delimiter, such as the domain after the @ or the last part of a file path.

Source: https://spreadsheetpractice.com/functions/textafter · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** TEXTAFTER returns everything after a delimiter, such as the domain after the @ or the last part of a file path.
- **Syntax:** `=TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])`
- **Most common use:** `=TEXTAFTER(A2,"@")` returns acme.com (The domain after the @)
- **Available in:** Excel 2024 and Microsoft 365
- **Category:** [Text functions](https://spreadsheetpractice.com/functions/category/text)
- **Returns:** The text after the chosen delimiter.

## What it does

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.

## Syntax

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

| Argument | Required? | What it is |
|---|---|---|
| `text` | Required | The text or cell to split. |
| `delimiter` | Required | The character or text to split at. |
| `instance_num` | Optional | Which delimiter to use: 1 for the first (default), 2 for the second, -1 for the last. |
| `match_mode` | Optional | 0 for a case-sensitive match (default), 1 to ignore case. |
| `match_end` | Optional | 1 treats the end of the text as a delimiter. The default is 0. |
| `if_not_found` | Optional | What to return when the delimiter isn't there, instead of #N/A. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=TEXTAFTER(A2,"@")` | acme.com | The domain after the @ |
| D3 | `=TEXTAFTER(B3,"/",-1)` | budget.csv | The file name after the last slash |
| D4 | `=TEXTAFTER(C4," - ",,,,"Pending")` | Pending | No status yet, so if_not_found fills in |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D |
|---|---|---|---|---|
| 1 | Email | Path | Order note | Result |
| 2 | maya.chen@acme.com | C:/reports/2026/q3.xlsx | Order 1042 - Shipped | acme.com |
| 3 | raj@globex.io | D:/archive/budget.csv | Order 1043 - Backorder | budget.csv |
| 4 | lee.wong@initech.net | E:/notes/today.txt | Order 1044 | Pending |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #N/A | The 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 end | TEXTAFTER 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).

## Related functions

- [TEXTBEFORE](https://spreadsheetpractice.com/functions/textbefore): TEXTBEFORE returns everything before a delimiter you name, such as the username before the @ in an email or the first name before a space.
- [RIGHT](https://spreadsheetpractice.com/functions/right): RIGHT returns a set number of characters from the end of a text string.
- [MID](https://spreadsheetpractice.com/functions/mid): MID returns characters from the middle of a text string, starting at a position you choose.
- [FIND](https://spreadsheetpractice.com/functions/find): FIND returns the position of one piece of text inside another, counting from 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.

## Practice

A graded TEXTAFTER exercise ("Domain") is on [the TEXTAFTER page](https://spreadsheetpractice.com/functions/textafter). It is checked instantly, then re-checked on changed data.

Lessons that use TEXTAFTER:

- [Lesson 21: TEXTBEFORE, TEXTAFTER & FIND](https://spreadsheetpractice.com/learn/textbefore-textafter-find) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
