What it does
RIGHT is the mirror image of LEFT: it starts counting at the last character and returns as many characters as you ask for, in their original order. When the end of a code has a fixed length (the last four digits, a two-letter colour suffix), RIGHT is all you need.
When the last part varies in length, calculate the number of characters: take the total length with LEN and subtract the position of the delimiter found with FIND. =RIGHT(A2,LEN(A2)-FIND(" ",A2)) returns everything after the first space.
In Microsoft 365, TEXTAFTER does the same with less typing and can find the last delimiter directly. For a part at the start or in the middle, use LEFT or MID.
Syntax
=RIGHT(text, [num_chars])=SAĞDAN(metin; [karakter_sayısı])Arguments in square brackets are optional. English Excel separates arguments with commas (,) and uses a dot for decimals; Turkish Excel uses semicolons (;) and a decimal comma. Excel shows function names in its own language when it opens the file.
Arguments
| Argument | Required | Description |
|---|---|---|
text | Required | The text to take characters from, or a cell. For numbers, the stored value is used, not the cell's formatting: a cell showing 1,250.00 holds 1250. |
num_chars | Optional | How many characters to take from the end. If omitted, 1; if larger than the text, the whole text is returned. It cannot be negative. |
Examples
1Get the sequence number from an invoice number
The last four digits of each invoice number are its sequence number. All numbers have the same length, so =RIGHT(A2,4) is enough.
=RIGHT(A2,4)| A | B | C | |
|---|---|---|---|
| 1 | Invoice No | Customer | Sequence |
| 2 | INV-2025-0042 | Brown & Sons | 0042 |
| 3 | INV-2025-0043 | Northgate Ltd | 0043 |
| 4 | INV-2025-0117 | Harbour Trade | 0117 |
| 5 | INV-2025-0118 | Star Market | 0118 |
- C2 (filled down to C5)
=RIGHT(A2,4)
C2 shows 0042; the result is text, so the leading zeros stay. To calculate with the sequence numbers, use =--RIGHT(A2,4).
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
2Take everything after the first space
The number of characters to take is the length of the text minus the position of the space, so every row returns all characters after the first space.
=RIGHT(A2,LEN(A2)-FIND(" ",A2))| A | B | |
|---|---|---|
| 1 | Full Name | Surname |
| 2 | Emma Brown | Brown |
| 3 | Mary Ann Clark | Ann Clark |
| 4 | Lucas Gray | Gray |
| 5 | Ava Thompson | Thompson |
- B2 (filled down to B5)
=RIGHT(A2,LEN(A2)-FIND(" ",A2))
B2 shows Brown. With two first names, the part after the first space has two words: B3 shows Ann Clark. The formula in the next example handles this case.
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
3Always get the last word
Each space is turned into 100 spaces with REPT; the last 100 characters then hold only the last word and some spaces, and TRIM removes the spaces.
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))| A | B | |
|---|---|---|
| 1 | Full Name | Surname |
| 2 | Emma Brown | Brown |
| 3 | Mary Ann Clark | Clark |
| 4 | Sophia Rose Hall | Hall |
| 5 | Lucas Gray | Gray |
- B2 (filled down to B5)
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
B3 now shows Clark and B4 shows Hall. In Microsoft 365, =TEXTAFTER(A2," ",-1) gives the same result.
We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.
Common errors and fixes
- #VALUE!
Cause: num_chars is negative, or the FIND that calculates it did not find the delimiter.
Fix: Make sure every row contains the delimiter, or wrap the formula in IFERROR.
- Missing character
Cause: The cell ends with an invisible space; RIGHT counts it first, so
=RIGHT(A2,4)returns three digits and a space.Fix: Clean the text with TRIM first:
=RIGHT(TRIM(A2),4).
Good to know
- RIGHT returns text. To calculate with sequence numbers such as "0042", use
=--RIGHT(A2,4). - For the part after the last delimiter, such as a file extension,
=TEXTAFTER(A2,".",-1)is the shortest route in Microsoft 365.
In Nexell
Get Nexell to do it from a sentence
Copy the last four digits of each invoice number into a new Sequence column
Convert to tableBring your invoice list into the tool and type this. Nexell builds the new column with a real Excel text formula and shows it in the preview first; the formula stays live in the downloaded file.
Nexell uses AI to understand the request and builds the result with real Excel formulas; the formula may differ from the example on this page. You see a preview first and nothing changes until you press Apply; formulas stay live in the downloaded .xlsx file.
Free account · no card needed · 30 credits a month
Frequently asked questions
How do I get the last word with RIGHT?
In Microsoft 365, use =TEXTAFTER(A2," ",-1). In older versions the well-known trick is to replace every space with 100 spaces, take the last 100 characters and trim them: =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)).
Can RIGHT and LEFT be combined?
Yes. For example, =LEFT(RIGHT(A2,7),3) returns the first three of the last seven characters. For a part in the middle, MID is usually easier to read.