Hello there,
Our marketing department asked me to assist with SMS responses. Customers (who are clearly not very smart) are asked to SMS their ID Numbers and Names to a short code to enter a competition.
The data is a mess. Some have ID numbers first, others last or in the Middle. SOme have full names, or no names, or no ID numbers, or they reply "hello, my name is Maria and this is mt address..." - you get the idea.
Here are a few cells:
[TABLE="width: 260"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Nthabiseng 199401230585086[/TD]
[/TR]
[TR]
[TD]Miss ME Khumalo 8301170818086[/TD]
[/TR]
[TR]
[TD]%P.XHANYWA8603261214087[/TD]
[/TR]
[TR]
[TD]Nthabiseng 9401230585086[/TD]
[/TR]
[TR]
[TD]Nthabiseng 9401230585086[/TD]
[/TR]
[TR]
[TD]Mìss L MOJA 8503101484082[/TD]
[/TR]
[TR]
[TD]T.P. Sikhakhane 7602290307087[/TD]
[/TR]
[TR]
[TD]My 7907210659081 my surname Mogajane motladi carron[/TD]
[/TR]
[TR]
[TD]ROCK YOLANDI 8304300045083[/TD]
[/TR]
[TR]
[TD]MATILDA NDLOVU ID 7501210515086[/TD]
[/TR]
[TR]
[TD]MATILDA NDLOVU ID 7501210515086[/TD]
[/TR]
[TR]
[TD]Eunice Jobson ID nom.8210120306086[/TD]
[/TR]
[TR]
[TD]E. M A R T H A S E G A K W E N G . 7808250789087[/TD]
[/TR]
[TR]
[TD]A.J. Pursent 8505251788089[/TD]
[/TR]
[TR]
[TD]Sipho david mabuza ID 8512015980085[/TD]
[/TR]
[TR]
[TD]RD.MASIPA 7703040567085[/TD]
[/TR]
[TR]
[TD]busisiwe violet mabena 7510070872081[/TD]
[/TR]
[TR]
[TD]E; P.P MTHEMBU& 8902110704086[/TD]
[/TR]
[TR]
[TD]Vidah,muguwelele,7104020105089[/TD]
[/TR]
[TR]
[TD]Dineo 8807250353083[/TD]
[/TR]
[TR]
[TD]P.E .TEMBE. 8004210289082.[/TD]
[/TR]
[TR]
[TD]P.E.ZULU.7710102163083
I need to extract the possible ID numbers to one cell, and the possible names to another (preferably using a formula and not VBA - I want the marketing guys to be able to do this themselves daily).
So far I have managed to extract all numbers in the cell (works pretty good, but not perfectly), using array formula
=MID(B2,MATCH(TRUE,ISNUMBER(1*MID(B2,ROW(B:B),1)),0),COUNT(1*MID(B2,ROW(B:B),1)))[/TD]
[/TR]
</tbody>[/TABLE]
For some reason the flipside of this (where I use ISTEXT and not ISNUMBER) does not work.
I also tried
=LEFT(B2,FIND("^^",SUBSTITUTE(" "&B2," ","^^",LEN(" "&B2)-LEN(SUBSTITUTE(" "&B2," ",""))))-1)
which SHOULD remove all numbers and keep text, but it doesn't work great (especially where there are commas or weird characters).
ANy ideas how I can do this in a better way?
Sorry for the long post
Gerhard
Our marketing department asked me to assist with SMS responses. Customers (who are clearly not very smart) are asked to SMS their ID Numbers and Names to a short code to enter a competition.
The data is a mess. Some have ID numbers first, others last or in the Middle. SOme have full names, or no names, or no ID numbers, or they reply "hello, my name is Maria and this is mt address..." - you get the idea.
Here are a few cells:
[TABLE="width: 260"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Nthabiseng 199401230585086[/TD]
[/TR]
[TR]
[TD]Miss ME Khumalo 8301170818086[/TD]
[/TR]
[TR]
[TD]%P.XHANYWA8603261214087[/TD]
[/TR]
[TR]
[TD]Nthabiseng 9401230585086[/TD]
[/TR]
[TR]
[TD]Nthabiseng 9401230585086[/TD]
[/TR]
[TR]
[TD]Mìss L MOJA 8503101484082[/TD]
[/TR]
[TR]
[TD]T.P. Sikhakhane 7602290307087[/TD]
[/TR]
[TR]
[TD]My 7907210659081 my surname Mogajane motladi carron[/TD]
[/TR]
[TR]
[TD]ROCK YOLANDI 8304300045083[/TD]
[/TR]
[TR]
[TD]MATILDA NDLOVU ID 7501210515086[/TD]
[/TR]
[TR]
[TD]MATILDA NDLOVU ID 7501210515086[/TD]
[/TR]
[TR]
[TD]Eunice Jobson ID nom.8210120306086[/TD]
[/TR]
[TR]
[TD]E. M A R T H A S E G A K W E N G . 7808250789087[/TD]
[/TR]
[TR]
[TD]A.J. Pursent 8505251788089[/TD]
[/TR]
[TR]
[TD]Sipho david mabuza ID 8512015980085[/TD]
[/TR]
[TR]
[TD]RD.MASIPA 7703040567085[/TD]
[/TR]
[TR]
[TD]busisiwe violet mabena 7510070872081[/TD]
[/TR]
[TR]
[TD]E; P.P MTHEMBU& 8902110704086[/TD]
[/TR]
[TR]
[TD]Vidah,muguwelele,7104020105089[/TD]
[/TR]
[TR]
[TD]Dineo 8807250353083[/TD]
[/TR]
[TR]
[TD]P.E .TEMBE. 8004210289082.[/TD]
[/TR]
[TR]
[TD]P.E.ZULU.7710102163083
I need to extract the possible ID numbers to one cell, and the possible names to another (preferably using a formula and not VBA - I want the marketing guys to be able to do this themselves daily).
So far I have managed to extract all numbers in the cell (works pretty good, but not perfectly), using array formula
=MID(B2,MATCH(TRUE,ISNUMBER(1*MID(B2,ROW(B:B),1)),0),COUNT(1*MID(B2,ROW(B:B),1)))[/TD]
[/TR]
</tbody>[/TABLE]
For some reason the flipside of this (where I use ISTEXT and not ISNUMBER) does not work.
I also tried
=LEFT(B2,FIND("^^",SUBSTITUTE(" "&B2," ","^^",LEN(" "&B2)-LEN(SUBSTITUTE(" "&B2," ",""))))-1)
which SHOULD remove all numbers and keep text, but it doesn't work great (especially where there are commas or weird characters).
ANy ideas how I can do this in a better way?
Sorry for the long post
Gerhard