The RIGHT function
The last characters of a text: an account's last four digits, a file extension, the code at the end of a reference.
Syntax
=RIGHT(text, [num_chars])
In a French Excel: =DROITE(texte; [no_car]).
Arguments
- text: the cell.
- num_chars: how many characters; 1 by default.
An example
=RIGHT(A2,4)
The last four characters of A2.
Pitfalls
- A trailing space counts as a character: TRIM first.
- A number loses its leading zeros before being read.
Going further
Frequently asked questions
- How do I take what follows the last hyphen?
- In Excel 365:
=TEXTAFTER(A2,"-",-1).