TEXTAFTER
Split a string and keep the part after a separator.
Syntax
TEXTAFTER(text, delimiter, [instance_num]) | Argument | Required | Description |
|---|---|---|
text | Required | The text to split. |
delimiter | Required | The separator to look for. |
instance_num | Optional | Which occurrence to split at. Defaults to the first; negative counts from the end. |
Examples
Every example below was executed against VisiGrid engine 0.35.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=TEXTAFTER("a-b-c","-") | b-c | Everything after the first hyphen, separators included. |
=TEXTAFTER("a-b-c","-",2) | c | |
=TEXTAFTER("a-b","-",-1) | b | Negative counts from the end. |
=TEXTAFTER("bo@visigrid.app","@") | visigrid.app |
Splitting a column in two
TEXTBEFORE and TEXTAFTER are the pair. One formula each, no character
arithmetic:
=TEXTBEFORE(A1, "@") → bo
=TEXTAFTER(A1, "@") → visigrid.app
The old way needed LEFT, MID,
LEN and FIND between them, and broke
differently at each end.
More than one separator
With three fields and two delimiters, the middle one is both functions nested:
=TEXTBEFORE(TEXTAFTER(A1, "-"), "-")
Take everything after the first hyphen, then everything before the next. For
more than three fields that nesting gets unpleasant — instance_num is usually
clearer:
=TEXTAFTER(A1, "-", 2)
Handle the missing case
Like TEXTBEFORE, no delimiter gives #N/A. Wrap
with IFNA when the column is not uniform:
=IFNA(TEXTAFTER(A1, "-"), "") Excel compatibility
Matches Excel, including instance_num and negative instance_num.