Hi Guys,
I’m extracting the Last Name but as can be seen there are cells with three words.
For cell with two words value it’s straight forward.
For cell with three words value, I want the middle value and last value
In this case (per ss), I want to extract: “Van Oord” as Last Name
Using either row("Name").ToString.Split(" "c).Last
or row("Name").ToString.Split(" "c).(1) will only extract one word value.
Can someone guide me on what to do if I want the middle and last value as Last Name?
Best I can think of atm is to use if condition to count substrings where if there are three values I extract index (1) and (2) as Last Name.
Update/Edit: The String Manipulation needs to work on both scenarios where there are two values words and three value words (in for each loop)
Appreciate the reply.
Could you show this formula in for each row form? (forgot to mention in the post)
Also does it work on both scenarios where there are two words value and three words value?