Remove last word in a string...

sharkbot

New Member
Joined
Feb 13, 2004
Messages
15
I need to remove the last word of a cell/string. This should be simple but I am braindead at the moment. Thanks for your help.

I have this:

Billy Bob's Law Office 700, Corporate Ste 201 ,


I need this:

Billy Bob's Law Office 700, Corporate Ste 201

So, basically I need to clip the comma off the end. I can't use a subsitute because it will replace all the commas. Thanks again.

Aaron
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Welcome to the Board -- to clarify, you want the last comma and everything after it to be gone?

EDIT -- If so, then --
FOO3.xls
ABCD
1BillyBob'sLawOffice700,CorporateSte201,ThisCityST
2BillyBob'sLawOffice700,CorporateSte201
Sheet3


A2: =LEFT(A1,FIND(CHAR(127),SUBSTITUTE(A1,",",CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))-1)
 
Upvote 0
If all your strings end in a space and a comma, then this should do the trick =left(A1,len(a1)-2)
Or, alternatively, =TRIM(left(A1,len(A1)-1))
Hope this addresses your problem sufficiently...
/s/Larry
 
Upvote 0
Thanks for the help, but the problem is that the lengths of the strings change (there are about 700 addresses where I need to clip the comma off the end). Im sorry, I forgot to mention that in the original post. Thanks

Aaron
 
Upvote 0
try...

=LEFT(A10,LEN(A10)-2)

...where A10 houses content.
 
Upvote 0
THANKS just_jon!

Your formula works great, I only needed to remove the comma, but I will use this formula as a learning tool for future reference. Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,212,933
Messages
6,110,752
Members
448,295
Latest member
Uzair Tahir Khan

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