Just a tricky string manipulation
MAIN PROBLEM:
Say I have a list of persons names in Column A. I want formulas in Columns B & C to return the individuals First & Last names respectively. This is easy when the names are separated by a space/full stop/underscore but what if there is no separator?
So cell A1 "JohnSmith" would need to return "John" in cell B1 and "Smith" in cell C1.
I can think of two ways to approach this:
- Identify first use of Upper case character where it is preceded by a lower case character
- Identify the use of an Upper case character after the first letter in the string (to avoid picking up J in JohnSmith)
SUB PROBLEM:
Now a twist just to make it more challenging. What happens if we have the cell data as SurnameFirstName instead? The formulas would need to handle Surnames starting with "O'", "Mac" & "Mc"...
So does anyone have a solution to the main problem?
Maybe even the the sub problem as well?![]()
Bookmarks