How to remove the last word from a cell in Excel
Excel formula
=TEXTBEFORE(A2," ",-1)Keep the text before the last space: =TEXTBEFORE(A2," ",-1) in Excel 365.
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Microsoft 365 only
- Google Sheets
- Different formula, see below
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
Instance -1 makes TEXTBEFORE split at the last space, so everything before it is kept however many words the title has.
In Google Sheets, the pattern matches the last space and the word after it at the end of the text, and REGEXREPLACE deletes them.
=TEXTBEFORE(A2," ",-1)Result"Cotton T-shirt"
A2"Cotton T-shirt Large"The value in A2.
-1-1Makes the value negative.
TEXTBEFORE(A2," ",-1)"Cotton T-shirt"TEXTBEFORE: Text before a delimiter.- text
A2"Cotton T-shirt Large" - delimiter
" " - instance_num
-1-1
- text
In Google Sheets
Google Sheets needs a different formula: =REGEXREPLACE(A2,"\s+\S+$",""). On the same data it gives the same result. Here it is running in Google Sheets mode.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =LEFT(A2,FIND(CHAR(1),SUBSTITUTE(A2," ",CHAR(1),LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))-1) | Cotton T-shirt, Wool socks, Rain jacket… | Works in every version: find the position of the last space and keep everything before it. |
Common mistakes
- A trailing space makes the last "word" empty, so nothing useful is removed. Use
TEXTBEFORE(TRIM(A2)," ",-1). - A one-word cell returns #N/A. Keep it unchanged with
=TEXTBEFORE(A2," ",-1,,,A2).
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Remove the last word from a cell
B2, remove the last word (the size) from the product title and fill down to B6.Questions
How do I remove the first word instead?
Keep the text after the first space: =TEXTAFTER(A2," ").
How do I get the last word itself?
Use =TEXTAFTER(A2," ",-1).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.