RIGHT Function (Gnumeric)
Learn the RIGHT function in Gnumeric: Returns the last character or characters of a text.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
The RIGHT function in Gnumeric is used for this task: Returns the last character or characters of a text. Extract a specified number of characters from the end of text.
This guide explains how to read the formula, reproduce a concrete example, interpret its result and recognize common input mistakes.
Availability and version history
- Introduced: Documented by 1.12.62; original introduction not established.
- Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
- Scope: Desktop; the fn-string function module must be included and enabled.
- Checked: Fresh official 1.12.57 source and bounded 1.12.57 native checks on October 17, 2026. Retained 1.12.62 availability registration is separate; no 1.12.62 runtime claim. Last functioning release was not established.
Syntax and arguments
=RIGHT(s,[num_chars])
s is the required input string. num_chars is optional and defaults to 1. Zero requests an empty string; a count at least as large as the text length returns the entire string. Negative counts produce #VALUE! in the inspected implementation. A nonnegative fractional count is truncated to an integer, but whole-number counts make the intention clearer.
Gnumeric counts UTF-8 characters rather than raw bytes in RIGHT. Logical string order, not the visual right edge of a right-to-left script, determines which characters are last. Combining marks and multi-codepoint emoji require care: a user-perceived symbol need not be one counted character.
Worked example
=RIGHT("Spreadsheet",5)
Expected result: sheet.
Why it works: Extract a specified number of characters from the end of text.
Suffix extraction fixture
| Formula | Expected result |
|---|---|
=RIGHT("ABC") |
C |
=RIGHT("ABC",0) |
Empty string |
=RIGHT("ABC",9) |
ABC |
=RIGHT("ABC",-1) |
#VALUE! |
=RIGHT("Lévy",3) |
évy |
These cases complement the preserved Spreadsheet example and matched the bounded native checks; the exported zero-count result was read back as an empty cell, consistent with the source-derived empty-string result. The character-count reasoning for Lévy is L, é, v, y: the last three are évy. This differs from treating the UTF-8 byte sequence as four single-byte letters.
For synthetic stock codes, put ITEM-007, PART-125 and UNIT-900 in A2:A4. =RIGHT(A2,3) filled down returns the text suffixes 007, 125 and 900. These are identifiers, so keep leading zeros rather than converting to numbers automatically. A display format that shows 007 for a numeric 7 does not necessarily make the underlying input the same text as ITEM-007.
Advanced use: fixed widths versus separators
RIGHT is appropriate when the suffix width is known. If one identifier ends in 7 and another in 125, taking three characters from both can include a separator or prefix. Determine the separator position and desired substring explicitly for variable-width formats, or validate the length before extraction.
Spaces are characters. A trailing space in a code is part of the suffix unless cleaned deliberately. Keep the original text in one column and extracted suffix in another so quality checks can reveal malformed codes; do not overwrite the source during a first cleanup pass.
Common problems and practical checks
- If the output is one character, check whether num_chars was omitted; the default is 1.
- If the whole string is returned, the requested count may simply exceed its length. This is not an error.
- Empty output can be an intentional count of zero. A negative count is an error, not a request to count from the opposite end.
- Count logical characters rather than screen width or bytes. RIGHTB is a different function with encoding-sensitive behavior.
- Test realistic Unicode and right-to-left data separately; this guide certifies only the listed valid-text fixtures, not every grapheme cluster or encoding edge case.
- Historical NEWS records Unicode-related fixes for RIGHT in 0.65; the original introduction is not identified by that maintenance entry.
Related functions
Documentation and verification
- Gnumeric official function catalog
- Historical notes reported a comparable LibreOffice Calc 25.2 example; that was not Gnumeric verification. The present listed scalar fixtures were separately recalculated with Gnumeric ssconvert 1.12.57 under C.UTF-8. Broader edge-case explanations are source-derived, and no GUI or screenshot is claimed.
- Official 1.12.57 string help and implementation.