+ Reply to Thread
Results 1 to 16 of 16

How to properly parse out the First & Last Names fields from the Full name column

  1. #1
    Registered User
    Join Date
    03-14-2020
    Location
    US
    MS-Off Ver
    Excel 2016
    Posts
    7

    How to properly parse out the First & Last Names fields from the Full name column

    I need to fill in every empty cell in the ‘First Name’, ‘Last Name’, and ‘Email Address’ fields. You can use Test Worksheet B to append the corresponding email address for each contact in Worksheet A, but you do not have that ability with the First Name and Last Name fields. You will have to figure out how to systematically and properly parse out the First and Last Names fields from the Full Name column, as there are too many rows to simply copy/paste

    I included the full excel sheet for workbook B. It is in the zip file.
    Attached Files Attached Files
    Last edited by Mason_98; 03-15-2020 at 12:34 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Maybe
    B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    L2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    M2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-14-2020
    Location
    US
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: How to properly parse out the First & Last Names fields from the Full name column

    The email address and Customer No. column seems incorrect. I'm getting N/A on most of them

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to properly parse out the First & Last Names fields from the Full name column

    I don't see that. I see 577 of the 10,000 records have #N/A

    Are you sure you've pasted the formula correctly.

    See attached. I've left the formulae in L2:M2 but converted the rest of the formulae to values
    I've had to save it as a .xlsb file since the .xlsx was just too large for the forum.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-14-2020
    Location
    US
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: How to properly parse out the First & Last Names fields from the Full name column

    The original file is too large to upload that's why I shorten it

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Unfortunately, parsing names CORRECTLY into first and last names given all possible last name forms, even ignoring Chinese and Korean names putting family (last) name first, is one of the hardest things there is to automate. In your A workbook, cell D101 shows ABDUL AL HALABI, and cell D106 shows CHOWDHURY AL-AMIN. I'd be willing to bet LOTS of money the D101 last name is AL HALABI. The issue is that there are LOTS of multiple word last names for those of European, Middle Eastern and Native American descent. You have some Spanish or Portuguese surnames starting in D2073 with IZZY DE ANDA, and D2072 is almost certainly another instance of a missing last name. Dutch/German multiple word surnames begin at cell 9132.

    Cell D352 shows ANDREW B. I'd also be willing to bet LOTS of money B isn't that person's last name. Meaning you have data quality problems which no formula or macro can fix. Another type of data problem is cell D2869 showing JODELLE FRANKLIN 108-275. Yet another, cell D6675 showing DEPARTMENT OF STATE.

    The most sensible approach is to assume only 2 word names with the 2nd name longer than 1 character spilt easily. ALL OTHER NAMES need to be split manually. Or there are Python modules with LOTS of logic and pattern matching databases for finding LIKELY multiple word last names.

    Anyway,

    B2: =IF(IF(LEN(D2)-LEN(SUBSTITUTE(D2," ",""))=1,LEN(SUBSTITUTE(REPLACE(D2,1,FIND(" ",D2),""),".",""))>1),LEFT(D2,FIND(" ",D2)-1),#N/A)
    C2: =IF(ISTEXT(B2),TRIM(SUBSTITUTE(D2,B2,"")),B2)

    Select B2:C3 and fill down as far as needed. The formulas which return #N/A you'll need to parse manually.

  7. #7
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    And of course there are can be exclusion that described hrlngrv. But part of then can be solved by substitution also. For example for AL-
    Please Login or Register  to view this content.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Please try at
    B2
    =LEFT(D2,FIND(C2,D2)-2)

    C2
    =TRIM(RIGHT(SUBSTITUTE(D2," ",REPT(" ",20)),20))


    Email and
    L2:M2
    =VLOOKUP($A2,'[Test Worksheet B- Copy.xlsx]Sheet1'!$A$2:$C$11168,COLUMNS($K2:L2),0)

    There are many N/A because no Contact ID in Test Worksheet B- Copy eg 344418

  9. #9
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: How to properly parse out the First & Last Names fields from the Full name column

    This also works in B and C columns:

    B2 =LEFT(D2;LEN(D2)-LEN(C2)-1)
    C2 same formula as Bo_Ry's post above.

    Drag down.

    As for columns L & M I get over 7500 #N/A.
    No idea how Richard Buttrey got only 577 #N/A.
    To show your appreciation
    Click ★ Add reputation!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Quote Originally Posted by Mrrrr View Post
    This also works in B and C columns:

    B2 =LEFT(D2;LEN(D2)-LEN(C2)-1)
    C2 same formula as Bo_Ry's post above.

    Drag down.

    As for columns L & M I get over 7500 #N/A.
    No idea how Richard Buttrey got only 577 #N/A.
    Using your original file containing 10000 records I copied the L2:M2 down all 10000 rows.
    Then filtered the file for #N/A on column L selected all the fultered records and noted the number 577 in the status bar at the bottom of Excel. And of course a normal
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    returns the same number.


    That's how I got the 577.
    As you can see in the workbook I returned where I'd range valued all ex ept L2:M2
    Last edited by Richard Buttrey; 03-15-2020 at 06:34 AM.

  11. #11
    Registered User
    Join Date
    03-14-2020
    Location
    US
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: How to properly parse out the First & Last Names fields from the Full name column

    I have updated and included the full excel sheet for workbook B. It is in the zip file. Please see if the functions will now work for all columns
    Last edited by Mason_98; 03-15-2020 at 01:17 PM.

  12. #12
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Quote Originally Posted by Richard Buttrey View Post
    That's how I got the 577.
    As you can see in the workbook I returned where I'd range valued all except L2:M2
    Well for example for the 2nd Contact ID which is 344418 I could not find a match with my formula (which was a normal INDEX-MATCH).

    I can only now find a match - when Mason_98 added the full workbook B - at row 44762 and the result is different from what your workbook shows:
    - your wkb in post #4: 344418 [email protected] CNT153610
    - Mason_98 latest update: 344418 [email protected] CNT008592
    - I got #N/A on that Contact ID with the previous version of Workbook B

    I no longer have the previous Workbook B to show you what I got, that I had no match for 344418 Contact ID.

    But maybe Mason_98 changed the workbook more than once which means you had a different version than I had... this is the only thing that would explain it really...

    Now with the full 48k rows Workbook B I get 7 #N/As in total.

  13. #13
    Registered User
    Join Date
    03-14-2020
    Location
    US
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Can you please show me your formulas with the updated workbook B please. The end result in Workbook A should have 10,001 rows with header row included. There are several duplicates (the exact same Full Name, Job Title, Company Name, Address, City, State, Post Code, Country).
    Last edited by Mason_98; 03-15-2020 at 08:00 PM.

  14. #14
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to properly parse out the First & Last Names fields from the Full name column

    Quote Originally Posted by Mason_98 View Post
    Can you please show me your formulas with the updated workbook B please. The end result in Workbook A should have 10,001 rows with header row included. There are several duplicates (the exact same Full Name, Job Title, Company Name, Address, City, State, Post Code, Country).
    To whom is this addressed.

  15. #15
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to properly parse out the First & Last Names fields from the Full name column

    If #13 was addressed to me then from myour zip file

    L2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    M2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B2 & C2 as previously mentione din #2 although I see there are some smaller versions which give the same result.

  16. #16
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: How to properly parse out the First & Last Names fields from the Full name column

    For B2 and C2 you could use the shorter formulas from posts #8 (Bo_Ry) or #9 (myself).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Matching Abbreviated names and Full names
    By s15 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-22-2015, 06:37 PM
  2. Cannot set column names properly in excel basic chart
    By VitoBdG in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-07-2015, 07:48 AM
  3. VBA to parse a text string containing three fields of different lengths
    By rupsidhu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2015, 09:01 PM
  4. Search a range Last Names for age & return the value to a List of FULL NAMES
    By LunarLights in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-16-2014, 05:02 PM
  5. I need Help to parse address city state zip and country if applicable for all fields
    By danpotash in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2013, 03:16 PM
  6. I have a column full of names and need to randomly pick 300 of them.
    By JoseK70 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2011, 08:17 PM
  7. How to parse date/time stamp into different fields?
    By chrishornbeck in forum Excel General
    Replies: 1
    Last Post: 05-07-2008, 12:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1