What is the RIGHT function?
=RIGHT(text, [num_chars])RIGHT returns the given number of characters from the end of a text. Use it for the serial at the end of a code, the last digits of a phone number or a file extension.
Click a character to take everything from there to the end; num_chars in the formula changes too.
Arguments
- text
- The text or cell to take characters from.
- num_chars
- Optional. How many characters to take from the end. If omitted, 1; if longer than the text, the whole text is returned.
RIGHT examples
Example 1. Number at the end of a code
=RIGHT("A-2026-0457", 4)The last 4 characters, "0457".
Example 2. Example from Microsoft
=RIGHT("Sale Price", 5)"Price".
Example 3. Domain after @
=RIGHT(A2, LEN(A2)-FIND("@", A2))The total length minus the position of @ is the number of characters after it.
Common mistakes
Results do not calculate
LEFT, RIGHT and MID return text even when it looks like a number. Wrap with VALUE or add 0, for example =RIGHT(A2,4)+0.
Trailing spaces
An invisible space at the end is taken too. Clean it up with TRIM first.
FAQ
- Can I combine it with LEFT?
- Yes, join them with &: =LEFT(A2,1)&RIGHT(A2,4).
- num_chars omitted?
- Only the last character is returned.