Splitting out the surname

bxcfilm

New Member
Joined
Apr 15, 2004
Messages
12
Office Version
  1. 2010
I have been provided with a spreadsheet with one column, a list of names. I want to separate out the surname into a separate column, but the format in which the names are written is not consistent. For example:

John Smith
James Edward Brown
Mr Michael Q Evans

In each case, the surname is the last word in the name, but Text To Columns doesn't seem to cope with this. I would appreciate any suggestions.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi,

First of all. This is not my idea. I saw this many years ago, but tbh I don't remember now who was it and can't provide a link:

=TRIM(RIGHT(SUBSTITUTE(A9," ",REPT(" ","99")),100))
 
Upvote 0
If you'd have Excel 2016 or higher, without formula, in case this is a one shot
- Type in a new column for each scenario a single example (thus typing the surname)
- Then highlight the full range in that column
- Press CTRL+E (flash fill)
 
Upvote 0
Hi,

First of all. This is not my idea. I saw this many years ago, but tbh I don't remember now who was it and can't provide a link:

=TRIM(RIGHT(SUBSTITUTE(A9," ",REPT(" ","99")),100))
That works a treat! Many thanks.
 
Upvote 0
In Power Query you can split the column by using a space delimeter for the right most space.

VBA Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Column1.1", "Column1.2"})
in
    #"Split Column by Delimiter"

Book1
AB
1Column1.1Column1.2
2JohnSmith
3James EdwardBrown
4Mr Michael QEvans
Sheet2
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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