RIGHT
Returns the rightmost characters from a text value.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=RIGHT(text, [num_chars])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
text | any | Required | — |
num_chars | any | Optional | — |
Return type
Can return text.
Remarks
num_charsdefaults to1when omitted.- If
num_charsexceeds length, the full text is returned. - Non-text values are coerced to text before slicing.
Error cases
- Negative
num_charsreturns#VALUE!.
Examples
Extract four ASCII characters from the selected end of a label.
Formula =RIGHT("East-2024",4)
Expected result 2024
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Omit the count and use the default of one.
Formula =RIGHT("East-2024")
Expected result 4
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A count of zero yields empty text.
Formula =RIGHT("East-2024",0)
Expected result ""
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A negative extraction count is invalid.
Formula =RIGHT("East-2024",-1)
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Take last three characters
Formula =RIGHT("engine", 3)
Expected result ine
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Default count is one
Formula =RIGHT("abc")
Expected result c
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
If num_chars is larger than the text length, what is returned?
RIGHT returns the full text when the requested count exceeds available characters.