How to right extract suffix in Excel
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.
Step-by-step instructions
How to right extract suffix — 3 steps
Reference the cell that contains the text.
Provide the number of characters to extract from the right end of the string.
Copy the formula down to apply it to every row in the column.
Example data
Worked example
| Account Number | Last 4 |
|---|---|
| ACCT-8821 | 8821 |
| ACCT-3340 | 3340 |
| ACCT-0017 | 0017 |
Common mistakes
Errors to watch out for
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.
FAQ
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.
Describe your exact spreadsheet problem — get the formula in seconds.
Open AI Formula Generator — FreeRelated how-to guides