RIGHT function
RIGHT returns characters from the end of a text string, such as a file extension or the last four digits of an ID. The result is text, even if it looks like digits.
Example
Read it as a sentence: take the last 2 characters of F3, a date stored as the number 45351, which gives 51.
Excel shows 51
F
1
2
'123
3
2024-02-29
Data
Syntax
RIGHT(text, [num_chars])
Arguments in [square brackets] are optional.
-
text(required) - The text to take characters from.
-
num_chars(optional) - How many characters to return; default 1.
Returns: The last characters of the text.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=RIGHT("Excel",2) | el | Basic |
=RIGHT("Excel") | l | Default 1 |
=RIGHT("Excel",0) | Zero | |
=RIGHT("Excel",10) | Excel | Longer than text |
=RIGHT(12345,2) | 45 | Number |
=RIGHT(Data!F3,2) | 51 | Date serial |
=RIGHT(Data!F1,2) | Blank | |
=RIGHT("Excel",-1) | #VALUE! | Negative |
The Data sheet these formulas read
A cell that starts with = holds that formula.
F
1
2
'123
3
2024-02-29
Data
Watch out for
- Result is text, even if digits.
- Default is a single character.
Where it works
- Excel
- RIGHT is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Text functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .