Concatenate name and add "."

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • Hi there,


    I was able to put the following formula together from searching online:


    =CONCATENATE(LEFT(TRIM(RIGHT(B30,LEN(B30)-IF(ISERROR(FIND(" ",B30,
    FIND(" ",B30,FIND(",",B30,1)+2))),LEN(B30),
    FIND(" ",B30,FIND(" ",B30,FIND(",",B30,1)+2))-1))),1)&".")


    I have a list of names in the format: last name, first name and middle initial (with and without a ".")


    I'm trying to split the names into separate columns and add the "." to the middle initial. However if the name does not have a middle initial I still get the ".". How can I make the formula add the "." only when there is a middle initial or name?
    For example, if I have the following names:


    [TABLE="width: 704"]

    [tr]


    [td]

    Name

    [/td]


    [td]

    Last

    [/td]


    [td]

    First

    [/td]


    [td]

    Middle

    [/td]


    [/tr]


    [tr]


    [td]

    Smith, John J.

    [/td]


    [td]

    Smith

    [/td]


    [td]

    John

    [/td]


    [td]

    J.

    [/td]


    [/tr]


    [tr]


    [td]

    Smith, John James

    [/td]


    [td]

    Smith

    [/td]


    [td]

    John

    [/td]


    [td]

    J.

    [/td]


    [/tr]


    [tr]


    [td]

    Smith, John

    [/td]


    [td]

    Smith

    [/td]


    [td]

    John

    [/td]


    [td][/td]


    [/tr]


    [/TABLE]



    Thank you in advance for your help

  • Re: Concatenate name and add "."


    Try:


    =IF(LEN(B30)-LEN(SUBSTITUTE(B30," ",""))=1,"",CONCATENATE(LEFT(TRIM(RIGHT(B30,LEN(B30)-IF(ISERROR(FIND(" ",B30,FIND(" ",B30,FIND(",",B30,1)+2))),LEN(B30),FIND(" ",B30,FIND(" ",B30,FIND(",",B30,1)+2))-1))),1)&"."))

    Where there is a will there are many ways. Finding one that works for you is the challenge!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!