VictoriaExcel
New Member
- Joined
- Nov 15, 2018
- Messages
- 14
Hi,
I have a list of thousands of names that need splitting into columns: prefix, first name, middle name, last name and suffix. The full names are varied and therefore the formulas I have tried thus far do not work on the whole list.
Formulas I have tried thus far:
Prefix
=LOOKUP(9.99E+307,SEARCH(Prefix,E7),Prefix)
To look up against a table of possible Prefix (downside being that I may not have captured all possibilities in this table)
First Name
=LEFT(G3,SEARCH(" ",G3))
Doesn't work if the name contains more than one prefix e.g. Professor Doctor Stephen Phillip DUNN
Middle Name
=MID(G3,SEARCH(" ",G3,1)+1,SEARCH(" ",G3,SEARCH(" ",G3,1)+1)-SEARCH(" ",G3,1))
This works in the main
Last Name
=RIGHT(G3,LEN(G3)-SEARCH("#",SUBSTITUTE(G3," ","#",LEN(G3)-LEN(SUBSTITUTE(G3," ","")))))
This picks up suffixes e.g. CBE, DL or last name not one or the other
Suffix
Same issue as prefix and last name
Example names:
[TABLE="width: 341"]
<colgroup><col></colgroup><tbody>[TR]
[TD][TABLE="width: 341"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Richard John William ALSTON CBE
William Blackledge BEAUMONT CBE DL
Ian Craig BLATCHFORD
Donald Hood BRYDON CBE
Rt Hon Alan CAMPBELL MP
Alastair Nathan COOK CBE
Professor Jeremy James FARRAR OBE
Professor Michael Anthony John FERGUSON CBE FRS
Professor Melvyn Francis GREAVES
Professor Alexander Norman HALLIDAY FRS
Professor David KLENERMAN FRS
James Henry LEIGH-PEMBERTON CVO
John Henry James LEWIS OBE
James MACKEY
Professor Jonathan Robert MONTGOMERY
Philip Nicholas Outram PULLMAN CBE
Rt Hon John Alan REDWOOD MP
Roy Alexander STONE CBE
Gary Nicholas STREETER MP
Dr Patrick John Thompson VALLANCE
Richard HEATON CB
Jonathan Michael THOMPSON
Gillian Elizabeth AITKEN
Myfanwy BARRETT
Julie GILLIS
Patricia Jane HAYES
Dr James Colin RICHARDSON
Neil THOMPSON
Peter Derek WATKINS CBE
Richard Ian WEST
Professor Madeleine Julia ATKINS CBE
Jayne-Anne GADHIA CBE
Ann Heron GLOAG OBE
Marianne GRIFFITHS
Lesley (Twiggy) LAWSON
[/TD]
[/TR]
</tbody>[/TABLE]
Thank you in advance! Any suggestions welcome.
Best wishes,
Victoria
[/TD]
[/TR]
</tbody>[/TABLE]
I have a list of thousands of names that need splitting into columns: prefix, first name, middle name, last name and suffix. The full names are varied and therefore the formulas I have tried thus far do not work on the whole list.
Formulas I have tried thus far:
Prefix
=LOOKUP(9.99E+307,SEARCH(Prefix,E7),Prefix)
To look up against a table of possible Prefix (downside being that I may not have captured all possibilities in this table)
First Name
=LEFT(G3,SEARCH(" ",G3))
Doesn't work if the name contains more than one prefix e.g. Professor Doctor Stephen Phillip DUNN
Middle Name
=MID(G3,SEARCH(" ",G3,1)+1,SEARCH(" ",G3,SEARCH(" ",G3,1)+1)-SEARCH(" ",G3,1))
This works in the main
Last Name
=RIGHT(G3,LEN(G3)-SEARCH("#",SUBSTITUTE(G3," ","#",LEN(G3)-LEN(SUBSTITUTE(G3," ","")))))
This picks up suffixes e.g. CBE, DL or last name not one or the other
Suffix
Same issue as prefix and last name
Example names:
[TABLE="width: 341"]
<colgroup><col></colgroup><tbody>[TR]
[TD][TABLE="width: 341"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Richard John William ALSTON CBE
William Blackledge BEAUMONT CBE DL
Ian Craig BLATCHFORD
Donald Hood BRYDON CBE
Rt Hon Alan CAMPBELL MP
Alastair Nathan COOK CBE
Professor Jeremy James FARRAR OBE
Professor Michael Anthony John FERGUSON CBE FRS
Professor Melvyn Francis GREAVES
Professor Alexander Norman HALLIDAY FRS
Professor David KLENERMAN FRS
James Henry LEIGH-PEMBERTON CVO
John Henry James LEWIS OBE
James MACKEY
Professor Jonathan Robert MONTGOMERY
Philip Nicholas Outram PULLMAN CBE
Rt Hon John Alan REDWOOD MP
Roy Alexander STONE CBE
Gary Nicholas STREETER MP
Dr Patrick John Thompson VALLANCE
Richard HEATON CB
Jonathan Michael THOMPSON
Gillian Elizabeth AITKEN
Myfanwy BARRETT
Julie GILLIS
Patricia Jane HAYES
Dr James Colin RICHARDSON
Neil THOMPSON
Peter Derek WATKINS CBE
Richard Ian WEST
Professor Madeleine Julia ATKINS CBE
Jayne-Anne GADHIA CBE
Ann Heron GLOAG OBE
Marianne GRIFFITHS
Lesley (Twiggy) LAWSON
[/TD]
[/TR]
</tbody>[/TABLE]
Thank you in advance! Any suggestions welcome.
Best wishes,
Victoria
[/TD]
[/TR]
</tbody>[/TABLE]