TEXTAFTER Function (Gnumeric)

Text Intermediate Gnumeric

Extract text after a chosen delimiter in Gnumeric using occurrence, case and fallback options.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked

TEXTAFTER function in Gnumeric

Quick answer

TEXTAFTER returns the part of a string after a chosen occurrence of a delimiter. Use it to extract a domain after @, a product variant after -, or a segment after the last separator in a code. Unlike a fixed-character extraction, it finds the delimiter before choosing where to split.

=TEXTAFTER("Blue-Shirt-XL","-",-1)

Expected: XL, because -1 selects the last hyphen. If you omit the third argument, the first matching hyphen is used. Gnumeric implementation, help_textafter and gnumeric_textafter.

Exact syntax and parameters (Gnumeric 1.12.61+)

=TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
Argument Required? Type and meaning Default
text Yes Input string or text cell reference. None
delimiter Yes String or array of delimiter strings; ordinary literal delimiters, not regex patterns. None
instance_num No Nonzero occurrence: positive from the beginning, negative from the end. 1
match_mode No 0 = case-sensitive; 1 = case-insensitive. 0
match_end No 0 = no virtual end delimiter; 1 = permit a match at the end of the text. 0
if_not_found No Result returned when no suitable delimiter instance exists. #N/A

In the English-locale examples, commas separate arguments. Different Gnumeric language/locale settings may display different separators; use the formula editor’s argument help if pasted punctuation is rejected. A delimiter is not a regular expression. The release-tag source declares the parameter signature SA|ffff and sets the above defaults. Source.

Reproduce an order-code example

  1. Enter the following sample codes in cells A2:A4.
  2. Put the formula =TEXTAFTER(A2,"-",-1) in B2.
  3. Copy B2 down to B4.
  4. Check the expected strings against the table.
Cell A: Code Formula in B Expected result
2 Blue-Shirt-XL =TEXTAFTER(A2,"-",-1) XL
3 Red-Hat-M =TEXTAFTER(A3,"-",-1) M
4 Bag-Tote-L =TEXTAFTER(A4,"-",-1) L

This example selects the last delimiter even when earlier hyphens occur. Conversely, =TEXTAFTER("Blue-Shirt-XL","-") gives Shirt-XL, because the default is occurrence 1.

Advanced scenario: extract the domain or specify case matching

For A2 containing buyer@example.ca, use =TEXTAFTER(A2,"@"). Expected: example.ca. A more defensive formula when the symbol may be absent is:

=TEXTAFTER(A2,"@",1,0,0,"MISSING_AT_SIGN")

If A2 contains buyer.example.ca instead, the expected output is MISSING_AT_SIGN, rather than the default #N/A. The fallback does not validate that an email address is genuine.

Case-sensitive and case-insensitive searches differ. =TEXTAFTER("Region-East/Ontario","east",1,1) has expected result /Ontario, whereas the same call with match_mode=0 produces expected #N/A. In this function, instance_num=0 yields #VALUE! according to Gnumeric’s implementation. Source.

Errors, limits and troubleshooting

  • #N/A: The delimiter or selected occurrence is absent. Inspect invisible spaces, spelling, case and the occurrence number, or supply if_not_found.
  • #VALUE!: instance_num=0 is invalid. Use 1 or -1 for the common cases.
  • Unexpected extra text: You requested the first delimiter. Use -1 to take text after the last one.
  • Unexpected empty string: A matched delimiter at the very end naturally has no text after it; match_end=1 also makes certain otherwise unmatched positive occurrences return an empty result. With a negative out-of-range occurrence and match_end=1, the tagged source instead returns the entire input. These advanced edge cases are documentation/source checks, not native tests.
  • Mixed delimiters: Gnumeric permits an array of delimiter strings, but the tie/overlap behavior was not validated in the app for this guide. Start with one literal delimiter if precision matters.
  • Version: Introduced in the Gnumeric 1.12.61 release notes and present in the 1.12.62 source; do not expect it in older Gnumeric versions. Availability also depends on the relevant function plugin/build.

Microsoft Excel for Microsoft 365 and Excel 2024 document a similar six-argument TEXTAFTER, but compatibility of every edge case or file round-trip was not tested. Older Excel releases can use combinations of FIND, MID and LEN; Google Sheets may use SPLIT or REGEXEXTRACT with different semantics. This guide’s Gnumeric behaviour comes from Gnumeric source, not from an Excel result. Microsoft comparison.

Official reference and verification

Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Gnumeric.

  • No genuine Gnumeric screenshots are included; this guide does not use mock application images.