RIGHT in Excel & Google Sheets
RIGHT is used in 1 formula pattern in this library. Browse worked examples below, or use the generator to build a custom variation for your specific data.
When to use RIGHT
- Extract the last 4 digits of an account number, the file extension from a filename, or a 2-character state code at the end of an address.
Worked examples (1)
Common errors with RIGHT
Wrong number of characters returned
RIGHT counts from the last character inward, so RIGHT(A2,4) always returns the final 4 characters regardless of total length.
Gets numbers instead of text
Wrap numeric cells in TEXT before using RIGHT — for example, RIGHT(TEXT(A2,"0000"),4) for a zero-padded 4-digit suffix.
Frequently asked questions
How do I extract everything after the last slash in a file path?
Use =RIGHT(A2, LEN(A2)-FIND("*",SUBSTITUTE(A2,"/","*",LEN(A2)-LEN(SUBSTITUTE(A2,"/",""))))) to find the last slash position and return everything after it.
Need a custom variation?
Describe your specific RIGHT problem and get a formula written for your exact data.
Open generator with RIGHT