Hi All
I have a Name field as below and need to extract the initials as shown in the field "initial". The problem is the varying lengths of first names making it difficult to use regex. I tried "REGEX_Replace([Surname], ".....(.*)", "$1")", however it works only for first names with five letters because of the five dots ".....".
Is there a way to drop the first word of the string, that occurs before a space? Then whatever remaining needs to be initial.. Attached excel with surnames and the desired initials that needs to recreated.
Initial | Surname |
PD & JA | MARTIN P D & J A |
AH & MM | RILEY A H & M M |
PADDOCK | N PADDOCK |
N | DALE N |
JE & M | YARNALL J E & M |
TW & CHUFY | LEE T W & CHU F Y |
Solved! Go to Solution.
@atcodedog05 Thank you :) - this works almost always. There is one exception though - in cases where there is two names such as SPENCER D & SIMPKIN A L - i would only need D & AL instead of D & SIMPKIN A L which is the case now.
Any way I can fix this?
Hi @Mj9715
Sorry, this is an outlier trying to include this might break the code.
Happy to help : )
Cheers and have a nice day!