
Extracts a chosen number of characters from the end of a text string.
The Excel RIGHT function returns characters from the end of a text string. It is the opposite of LEFT, which starts from the beginning. For example, =RIGHT("report.xlsx",4) returns "xlsx".
RIGHT is useful when the part you need is always at the end of the value. Common examples are suffixes, file extensions, and the last digits of a code or phone number.
Returns the last part of a text string based on the number of characters you request.
Returns the extracted ending text. If you ask for too many characters, Excel returns the whole string.
=RIGHT(text, [num_chars])
text is the source value. num_chars is how many characters to return from the end. If you omit num_chars, Excel uses 1.
RIGHT, LEFT, and MID all extract text, but they start from different places. RIGHT is the best choice when the needed part is at the end.
| Function | Starts From | Use When |
|---|---|---|
RIGHT |
The last character | The needed text is at the end |
LEFT |
The first character | The needed text is at the beginning |
MID |
A chosen position | The needed text is in the middle |
FIND / SEARCH |
- | You need to calculate how much text comes after a delimiter |
RIGHT is simple when the suffix length is fixed. A formula like =RIGHT(A1,3) can return the final three characters from every row in a code column.
When the ending part can be different lengths, RIGHT is often combined with LEN and FIND. For example, =RIGHT(A1,LEN(A1)-FIND(".",A1)) returns everything after the dot in a filename.
This is the direct use of RIGHT. Excel counts backward from the end of the string and returns the requested number of characters.
=RIGHT("ExcelClash", 5) // "Clash"
=RIGHT("ENG-2026", 4) // "2026"
=RIGHT("MTL-001-A", 1) // "A"
In cell F1, use RIGHT to extract the last 5 characters from "ExcelClash". Expected result: "Clash".
If the code always ends with the same kind of suffix, RIGHT can return it directly. This is common with serial numbers, revisions, and short numeric endings.
=RIGHT(A1, 3) // "MTL-999" -> "999"
In cell F2, use RIGHT on A1 ("MTL-999") to get the last 3 characters. Expected result: "999".
RIGHT is often used to return the last few digits of a phone number, especially when building masked displays or helper columns for grouping.
=RIGHT(B2, 4) // "555-1234" -> "1234"
In cell F3, use RIGHT on B2 ("555-1234") to extract the last 4 characters. Expected result: "1234".
If the extension length can change, RIGHT alone is not enough. LEN gives the total length, FIND gives the position of the dot, and the difference tells RIGHT how many characters to return.
=RIGHT(C1, LEN(C1)-FIND(".",C1))
// "data.xlsx" -> "xlsx"
// "report.csv" -> "csv"
In cell F4, use FIND and RIGHT together to extract everything after the last dot in C1 ("data.xlsx").
RIGHT returns text, even when the extracted part looks numeric. If you need to use the result in a calculation, you may need to convert it afterward.
RIGHT returns characters from the end of a text string.=RIGHT(text, [num_chars]).Tell your friends about this post