+ Reply to Thread
Results 1 to 6 of 6

Name cosolidation

  1. #1
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Name cosolidation

    Hi every body, could you please help me

    I have list of Full Name in column A and wanna get result in column B:

    Column A / Column B

    Nguyen Ngoc Tuan Anh / AnhNNT


    Doan Thu Nguyet / NguyetDT

    Tran Viet / VietT

    What formula can I use? (No VBA)

    Thanks in advance

  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: Name cosolidation

    Why the reluctance to use VBA which I suspect in this case would be much easier?

    Regards
    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
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Name cosolidation

    Yes, i agree. I can't think of a direct formula that will do this. Even if there is one, it will be excessively complicated. Why not use VBA?

  4. #4
    Registered User
    Join Date
    01-10-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Name cosolidation

    Yes, this is better in vba. But it can be done without.

    For the easiest example, Tran Viet / VietT, you can use this (where a2 is the cell containing the full name):

    =RIGHT(A2,LEN(A2)-SEARCH(" ",A2,1))&LEFT(A2,1)

    For the hardest example, Nguyen Ngoc Tuan Anh / AnhNNT, it is more complicated as you have to find successive spaces (in this case A8 contains the full name):

    RIGHT(A8,LEN(A8)-SEARCH(" ",A8,(SEARCH(" ",A8,SEARCH(" ",A8,1)+1))+1)) & LEFT(A8,1) & MID(A8,SEARCH(" ",A8,1)+1,1) & MID(A8,SEARCH(" ",A8,SEARCH(" ",A8,1)+1)+1,1)

    See the attached example spreadsheet.

    Now the issue is that, if it doesn't find extra spaces, you will get an error. To get around that you could either concoct a huge IF statement using the ISERROR function to find out how many spaces you have, or have separate columns to find each successive space and therefore initial, then a final column with an IF statement using the ISERROR function to determine how many of your initials you concatenate with the final name.

    Alternatively you can just visually determine which names need which version of the formula...

    I hope that helps...
    ssu95bm
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-10-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Name cosolidation

    I've just thought of an even easier way to do this.

    Export your full name column (just that column) as text. The re-import it, as delimited data, with the space as the delimiter. This will then allow you to spread the different parts of the name accross a set of columns, and it is then easy to do the consolidation.

    For example, cells A13-D13 contain the four possible parts of the name, then E13 would look like this:

    =IF(D13<>"",D13&LEFT(A13,1)&LEFT(B13,1)&LEFT(C13,1),IF(C13<>"",C13&LEFT(A13,1)&LEFT(B13,1),B13&LEFT(A13,1)))

    Using the if statement takes account of how many parts of the name there will be (and that the last name will be in either B13, C13 or D13 accordingly).

    See revised example worksheet.

    Hope that helps!
    ssu95bm
    Attached Files Attached Files

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Name cosolidation

    If your query is resolved, please mark the Thread as Solved. Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

    If you found any post helpful, please rate it accordingly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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