+ Reply to Thread
Results 1 to 8 of 8

Splitting names by delineator not occurring in the same location

  1. #1
    Registered User
    Join Date
    07-19-2020
    Location
    NH, US
    MS-Off Ver
    2016
    Posts
    19

    Splitting names by delineator not occurring in the same location

    I've attached the workbook with my desired before and after. I'm looking to split the names but I already have your basic trim formula that will split cookie cutter names (IE: row 2-3). I'm working with Spanish names where "Cruz" ends up in the last name column when I need it to be "de la Cruz". I have a lot of "de" names and can make it work if I can make a "de" exception to my formula and make it split only on the last occurrence of the "de" since sometimes I have long names (see row 5).

    I'm using:

    =LEFT(A2,FIND(” “,A2,1)-1)
    =RIGHT(A2,LEN(A2)-FIND(” “,A2,1))
    Attached Files Attached Files

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

    Re: Splitting names by delineator not occurring in the same location

    Plaese try at
    B2
    =LEFT(A2,LEN(A2)-LEN(C2)-1)

    C2
    =TRIM(RIGHT(IF(ISERR(SEARCH(" de ",A2)),SUBSTITUTE(A2," ",REPT(" ",50)),SUBSTITUTE(PROPER(A2)," De ",REPT(" ",50)&"De ")),50))
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Splitting names by delineator not occurring in the same location

    Try this formula in C2 and then Fill down

    I have written it this way so that it can handle names like De Giant, La Giant and De La Giant

    =RIGHT(A2,LEN(A2)-FIND("$",SUBSTITUTE(A2," ","$",LEN(SUBSTITUTE(SUBSTITUTE(A2," La "," La_")," De "," De_"))-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2," La "," La_")," De "," De_")," ","")))))
    Last edited by mehmetcik; 09-07-2020 at 01:06 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    07-19-2020
    Location
    NH, US
    MS-Off Ver
    2016
    Posts
    19

    Re: Splitting names by delineator not occurring in the same location

    Quote Originally Posted by Bo_Ry View Post
    Plaese try at
    B2
    =LEFT(A2,LEN(A2)-LEN(C2)-1)

    C2
    =TRIM(RIGHT(IF(ISERR(SEARCH(" de ",A2)),SUBSTITUTE(A2," ",REPT(" ",50)),SUBSTITUTE(PROPER(A2)," De ",REPT(" ",50)&"De ")),50))
    This one works really great, thank you! Is there any way to also add another variation? Meaning we get the "de" variations, I'd also like to add "D'la" because it's reported like that often as well. So something like de or d'la or etc etc.

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

    Re: Splitting names by delineator not occurring in the same location

    Please provide more sample with manually calculated results.

  6. #6
    Registered User
    Join Date
    07-19-2020
    Location
    NH, US
    MS-Off Ver
    2016
    Posts
    19

    Re: Splitting names by delineator not occurring in the same location

    Updated sample data.
    Attached Files Attached Files

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

    Re: Splitting names by delineator not occurring in the same location

    Plaese try at
    B2
    =LEFT(A2,LEN(A2)-LEN(C2)-1)

    C2
    =TRIM(RIGHT(IF(ISNA(LOOKUP(0,-SEARCH({" de ","d'la"},A2))),SUBSTITUTE(A2," ",REPT(" ",50)),SUBSTITUTE(SUBSTITUTE(PROPER(A2)," De ",REPT(" ",50)&"De ")," D'La ",REPT(" ",50)&"d'la ")),50))
    Attached Files Attached Files

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Splitting names by delineator not occurring in the same location

    Hi,

    =MID(A2,-LOOKUP(1,-SEARCH(" "&{"ω","de","de la","d'la"}&" ",SUBSTITUTE(A2," "," ω ",LEN(A2)-LEN(SUBSTITUTE(A2," ","")))))+1,99)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

+ 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. [SOLVED] Splitting Names
    By ryanhofrichter in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-06-2020, 01:59 AM
  2. Replies: 3
    Last Post: 07-01-2017, 12:58 AM
  3. Macro is splitting a column in the wrong location.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2016, 12:16 PM
  4. [SOLVED] Splitting data location wise from 3 sheets in 1 workbook
    By Kalpesh93 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2015, 10:11 AM
  5. Can I distribute text across columns when my delineator is a line break?
    By Joanne Marie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2015, 05:46 AM
  6. Replies: 2
    Last Post: 02-11-2015, 05:41 AM
  7. [SOLVED] Splitting names
    By rwl518p in forum Excel General
    Replies: 4
    Last Post: 09-04-2012, 05:23 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