Last Word in a Cell

Shymanas

New Member
Joined
Aug 12, 2009
Messages
42
Hi,

I have following words in a Cell:

John Peter Smith
Alex J Peter Albert

I want to move the last word only into a new cell.

So in the first example, Smith would go into the next cell and for the second example Albert would go into the next cell.

Any idea how to do this?

Thanks
Shai
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

Thanks for this.

I also have a scenario where the name is:

Mr P. T. Smith

Is there is a full stop before the last word then it doesn't seem to work.

Any ideas?

Thanks
Shai
 
Upvote 0
Actually for some reason the formula given is inconsistent.

It doesnt work for some fields but works for others and the fields are c=just different in content.

Thanks Shai
 
Upvote 0
Hi I think the error in this formula comes when there is just a full stop and no space between the last part and the previous ie

Mr John P.T.Smith would cause an error but
Mr John P. T. Smith would not,

This can be solved by first running this formula to replace any full stops with a space, If data starts in A2...

=substitute(A2,"."," ")

Once you have ran this formula through all the entries, copy and paste special values only back into column A and re run the formula given above.

It should then work.
 
Upvote 0
That's right - if the data is inconsistent you might need some more in the formula - this version would treat a . like a space and take everything after the last one of either of those - also modified to cope with spaces at the end of the data

=TRIM(RIGHT(SUBSTITUTE(TRIM(SUBSTITUTE(A2,"."," "))," ",REPT(" ",99)),99))
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

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