Function · Text

Excel RIGHT function

The Excel RIGHT function returns the last characters of a text value. The last five characters of INV-10428 are 10428.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =RIGHT(text, [num_chars])

RIGHT
=RIGHT("INV-10428",5)

Arguments

NameRequiredWhat to pass
textRequiredThe text, or a cell that holds it.
num_charsOptionalHow many characters to take from the end. The default is 1.

Examples

The numeric tail of an invoice id

=RIGHT(B1,5)

Result 10428

=RIGHT(B1,5)B2
Invoice
AB
1InvoiceINV-10428
2Last 510428
A picture of the sheet, not a live calculator. INV-10428 has 9 characters. The last 5 are 10428.

RIGHT takes characters from the end. INV-10428 is nine characters, and the last five are 10428. The hyphen is not one of them. The result is text, even when every character is a digit. Summing a column of those tails will ignore them until you convert with VALUE, and VALUE will drop a leading zero.

Use RIGHT for a suffix whose position is fixed. Use SEARCH or FIND plus MID when the piece you want sits after a word that moves.