Pull the last word — a surname, a file extension, a unit. The classic trick pads the last space out wide so RIGHT can grab the final chunk, no matter how many words.
The example
The last word isolated from a phrase.
| A | B | |
|---|---|---|
| 1 | Text | Last word |
| 2 | Ann Marie Lee | Lee |
The formula
Pad spaces, grab the right end:
How it works
The space-padding trick:
SUBSTITUTE(A2, " ", REPT(" ", 100))replaces every space with 100 spaces, spreading the words far apart.RIGHT(…, 100)grabs the last 100 characters — guaranteed to contain just the final word (plus padding).TRIMremoves the extra spaces, leaving the last word.- In Excel 365,
TEXTAFTER(A2, " ", -1)does it directly — the-1means “after the last space.”
Why 100? It just needs to exceed the longest word. Bump it higher for very long words. The 365 TEXTAFTER(A2, " ", -1) avoids the whole trick — use it where available.
Try it: interactive demo
Type text; get the last word.
Variations
365 version
Direct:
File extension
After the last dot:
Everything but last word
The rest:
Pitfalls & errors
Padding width. 100 must exceed the longest word; increase it for unusually long tokens.
Trailing spaces. A space at the end can make the “last word” blank — TRIM the input first.
Single word. With no space, the trick returns the whole (trimmed) word — which is correct.
Practice workbook
Frequently asked questions
How do I extract the last word in Excel?
Why does the formula use REPT(" ",100)?
What's the simplest modern version?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class