FP

FormulaPilot

Spreadsheet formula tools

Open generator
Excel how-to guide

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.

beginnerText ManipulationRIGHT reference

Step-by-step instructions

How to right extract suffix3 steps

1

Reference the cell that contains the text.

2

Provide the number of characters to extract from the right end of the string.

3

Copy the formula down to apply it to every row in the column.

Example data

Worked example

Account NumberLast 4
ACCT-88218821
ACCT-33403340
ACCT-00170017

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.

Need a custom variation?

Describe your exact spreadsheet problem — get the formula in seconds.

Open AI Formula Generator — Free

Related how-to guides

Continue learning.