Hi,
Assume a column of names as follows:
Name
Mohammed Zia-Ul Haque
Steven Thomas –
,-Rohit Sunil Ahir-Chowdhary.-
Anuj ———–
Sameer —
..,Mohit —
Rajeev Nair.
Monalisa . Das
Vijeta …
–,.Anjana. M.U..,-
Please observe that there are special characters before the name, within the name and after the name. The task is to remove special characters before and after the name. The expected result is shown below:
Expected Result
Mohammed Zia-Ul Haque
Steven Thomas
Rohit Sunil Ahir-Chowdhary
Anuj
Sameer
Mohit
Rajeev Nair
Monalisa . Das
Vijeta
Anjana. M.U
The array formula (Ctrl+Shift+Enter) to make this work is
=MID(A2,MIN(SEARCH(CHAR(ROW($A$65:$A$90)),A2&CHAR(ROW($A$65:$A$90)))),LOOKUP(2,1/((CODE(MID(UPPER(A2),ROW(INDIRECT(“1:”&LEN(A2))),1))>=65)*(CODE(MID(UPPER(A2),ROW(INDIRECT(“1:”&LEN(A2))),1))<=90)),ROW(INDIRECT(“1:”&LEN(A2))))-(MIN(SEARCH(CHAR(ROW($A$65:$A$90)),A2&CHAR(ROW($A$65:$A$90)))))+1)
I have solved a similar problem at this link as well but that requires the usage of an add-in. This is so because the special characters and numbers need to be removed from within the string as well. In other words, everything except letters need to be removed from the alphanumeric string (no matter where the numbers and special characters are – beginning, middle or at the end).
Remove special characters from a string
{ 4 Comments }