RIGHT extracts characters from the end of a text value. Use it to pull file extensions, last digits of codes, suffixes, and trailing identifiers.
RIGHT extracts a specified number of characters from the end (right side) of a text string. Use it to get file extensions, last digits of account numbers, country codes at the end of a string, or any fixed-length suffix.
=RIGHT(text, [num_chars])| Argument | Description |
|---|---|
| text required | The text string or cell reference to extract from. |
| num_chars optional | How many characters to extract from the right. Defaults to 1. |
=RIGHT(A2, 4) ← "report.xlsx" → "xlsx"=RIGHT(A2, 4) ← "****-****-1234" → "1234"=RIGHT(A2, 4) ← "Q3-REPORT-2026" → "2026"=IF(RIGHT(A2, 3)="Ltd", "Company", "Individual")=RIGHT(A2, LEN(A2) - FIND("*", SUBSTITUTE(A2," ","*",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))Complex but powerful — extracts the last word regardless of string length.
Extract everything AFTER a known separator:
Extract after the last hyphen:
=RIGHT(A2, LEN(A2) - FIND("-", A2))
"INV-001" → "001"
RIGHT is most useful when your data has a consistent structure where the meaningful piece comes at the end. File extensions, country codes appended to product codes, year digits at the end of reference numbers, and check digits at the end of identifier strings all suit RIGHT perfectly.
A common real-world use is extracting the year from invoice references like "INV-2026-001" — but here YEAR or RIGHT from the end won't work because the year is in the middle, not the end. RIGHT works for "001-2026" where the year is at the end. Recognising which end your data is structured from is the key to choosing between LEFT, RIGHT, and MID.
RIGHT combined with LEN creates a powerful pattern for removing a known prefix of variable length: =RIGHT(A2, LEN(A2)-FIND("-",A2)) extracts everything after the first hyphen, regardless of how long the prefix is. This generalises to any separator and handles variable-length strings cleanly.
ExcelPro has text extraction exercises across all specialist tracks. Free to start.
Try text exercises →