Results 1 to 5 of 5

Thread: Excel Formula - How to separate full name
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2017
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Excel Formula - How to separate full name

    Hi,


    Please help me regarding these below:


    1st. How to get all capital letters in a cell. I want to get only the "DEL REY(AM)"

    Sample: Alejandro Jay DEL REY(AM)


    2nd. How to get the remaining full first name. I want to get only the "Alejandro Jay"




    Thank you.

  2. #2
    Board Regular kweaver's Avatar
    Join Date
    May 2018
    Location
    La Jolla, CA
    Posts
    644
    Post Thanks / Like
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel Formula - How to separate full name

    There are a few ways. If you have Excel 365 or so, you can put: Alejandro Jay into B1 (assuming the full string is in A1) and then use Flash Fill from the DATA tab on the ribbon.
    The same would apply to the location by typing JUST THE LOCATION (e.g., Del Ray(AM)) into C1 and using Flash Fill.

    If not, you can extract just the name, assuming there is a space between the first and last name and a space after the last name, using:

    Code:
    =LEFT(A1,FIND(" ",A1,FIND(" ",A1)+1)-1)
    You can extract everything AFTER the space which is after the last name using:

    Code:
    =RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1)+1))
    Last edited by kweaver; Jul 4th, 2019 at 01:22 AM.

  3. #3
    New Member
    Join Date
    Oct 2017
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel Formula - How to separate full name

    Hi kweaver,

    But can you help me how to get only the big letter in a Cell,
    Example
    1. Alejandro Jay DEL REY(AM), then I want only to get all capital letter which is "DEL REY(AM)"
    2.
    Filippo BERGAMASCHI , will get only the BERGAMASCHI


    Regards,

  4. #4
    Board Regular tyija1995's Avatar
    Join Date
    Feb 2019
    Posts
    648
    Post Thanks / Like
    Mentioned
    14 Post(s)
    Tagged
    4 Thread(s)

    Default Re: Excel Formula - How to separate full name

    Hey,

    If the format is consistent in that the capitals always come at the end (and there are no other funny characters such as "[" etc) then try this:

    Code:
    Function NONCAPITALS(txt As String) As String
    Dim rgx As Object
    Set rgx = CreateObject("VBScript.RegExp")
        rgx.Global = True
        rgx.Pattern = "([A-Z]{2,})"
        NONCAPITALS = rgx.Replace(txt, "")
    End Function
    To use - lets say A1 = "Alejandro Jay DEL RAY(AM)"
    B1:
    Code:
    TRIM(SUBSTITUTE(SUBSTITUTE(NONCAPITALS(A1),CHAR(40),""),CHAR(41),""))
    C1:
    Code:
    TRIM(REPLACE(A1,1,LEN(B1),""))
    B1 result: "Alejandro Jay"
    C1 result: "DEL RAY(AM)"
    √-1 2³ ∑ π
    …And it was delicious!

  5. #5
    Board Regular
    Join Date
    Oct 2013
    Location
    Lakeland, FL USA
    Posts
    395
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel Formula - How to separate full name

    Try this
    Enter formula in cell B1 and drag formula across to C1

    Code:
    =TRIM(MID(SUBSTITUTE(SUBSTITUTE($A1," ",",",2),",",REPT(" ",50)),50*(COLUMNS($A:A)-1)+1,50))

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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