Need Excel formula to delete the last word in a cell

jhillas

New Member
Joined
Dec 3, 2003
Messages
10
Hello,

This seems so easy, but I can't get it to work correctly.
If a cell or group of cells contains a product description, and the last word is undesired in all the cells, how would we go about this? I've found this formula to delete the first word:

=RIGHT(A1,LEN(A1)-FIND(" ", A1,1))

before:
This is a test.

after
is a test.

What is desired is:
This is a

Thank you.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Thank you santeria, I'll check it out.
2rrs, I tried "left" and it works, but not correctly, for example.

Cell A1 contains:

This is a very long test C340409

Using "left", will return the results:

This is a very long test C34

The formula only deletes 5 characters back.
 
Upvote 0
jhillas said:
Hello,

I've found this formula to delete the first word:

=RIGHT(A1,LEN(A1)-FIND(" ", A1,1))

This is a

Thank you.

This formula will work if the last space is in the last six characters of the entry. If the last space is more than six characters from the end then you would have to modify this formula. Maybe it will give you some idea how to proceed.

=LEFT(A1,FIND(" ",A1,LEN(A1)-6))
 
Upvote 0
y031211h1.xls
ABCD
1Thisisatest.Thisisa
Sheet8


The formula in cell B1 is ...

=LEFT(TRIM(A1),FIND("~",SUBSTITUTE(A1," ","~",LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))))-1)
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top