Last active
June 15, 2019 09:33
-
-
Save prikkprikkprikk/701d45dedc0f43ba075b6cfdc6fc25e8 to your computer and use it in GitHub Desktop.
Excel: Split names (regardless of number of first and middle names)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These formulas will split names into first and middle names, and last name, respectively. | |
Alan Bega => Alan / Bega | |
Alan Brian Carr => Alan Brian / Carr | |
Alan Brian Cory Dorset => Alan Brian Cory / Dorset | |
… etc | |
Extract first and middle names: | |
= LEFT( B2; SEARCH("#"; SUBSTITUTE(B2;" "; "#"; LEN(B2) − LEN(SUBSTITUTE(B2; " "; "")))) -1 ) | |
Extract last name: | |
= RIGHT(B2; LEN(B2) − SEARCH("#"; SUBSTITUTE(B2;" "; "#"; LEN(B2) − LEN(SUBSTITUTE(B2; " "; ""))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment