+ Reply to Thread
Results 1 to 8 of 8

Retrieve 1st Letters from Full Name

  1. #1
    Registered User
    Join Date
    04-01-2014
    Location
    Kerala
    MS-Off Ver
    Excel 2007
    Posts
    7

    Thumbs up Retrieve 1st Letters from Full Name

    Hi

    am using MS Office 2007

    I have a column (eg: A) contains NAMES which consists of 1 word name (First name), 2 word names(First name & Last name) and 3 word names (First name , Middle name and Last name).

    Eg.

    Column A
    =======
    Xavier
    xavier jose
    Xavier jose kozhiparambil

    etc....

    i appreciate your help in obtaining result in

    Column B
    =======
    X
    X J
    X J K

    respectively ...... (i.e. X for Xavier; X J for Xavier Joseph; X J K for Xavier Jose Kozhiparambil)
    in B

    with 1 space between all Characters - all CAPS (irrespective of what the source case is)
    Please refer to the Excel file for any clarification.

    Please do help me asap
    Attached Files Attached Files
    Last edited by Accusoft; 04-04-2014 at 11:32 PM. Reason: SOLVED

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Retrieve 1st Letters from Full Name

    Try this, copied down...
    =UPPER(LEFT(A5,1))&
    IF(LEN(A5)-LEN(SUBSTITUTE(A5," ",))>=1, " "&UPPER(MID(A5,LEFT(FIND(" ",A5,1))+1,1)),"")&
    IF(LEN(A5)-LEN(SUBSTITUTE(A5," ",))>1," "&UPPER(MID(A5,FIND(" ",A5,FIND(" ",A5,1)+1)+1,1)))

    This will only work for up to 3 names
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Retrieve 1st Letters from Full Name

    Or:

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


    @Ford: you could put the UPPER around the whole formula rather than repeating it for each name.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Retrieve 1st Letters from Full Name

    @Ford; did you copy that formula up to row 3 for the 2 and 1 names?

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Retrieve 1st Letters from Full Name

    Thanks for the catch Trevor, I thought I had copied upwards to test, but apparently not

    Sooooo fixing that, and updating the UPPER as suggested, that becomes...
    =UPPER(LEFT(A5,1)&
    IF(LEN(A5)-LEN(SUBSTITUTE(A5," ",))>=1, " "&MID(A5,LEFT(FIND(" ",A5,1))+1,1),"")&
    IF(LEN(A5)-LEN(SUBSTITUTE(A5," ",))>1," "&MID(A5,FIND(" ",A5,FIND(" ",A5,1)+1)+1,1),""))

    But Trevor's is still slicker

  6. #6
    Registered User
    Join Date
    04-01-2014
    Location
    Kerala
    MS-Off Ver
    Excel 2007
    Posts
    7

    Thumbs up Re: Retrieve 1st Letters from Full Name

    I really appreciate your work Mr. Ford and Mr. TMS... thank a lot

    Great job....

    everything worked fine except a small difference.....

    please refer the attachment, row 13

    i couldn't guess, why the difference?
    Attached Files Attached Files

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Retrieve 1st Letters from Full Name

    Becasue I had a "LEFT" in there that should not be there

    =UPPER(LEFT(A13,1)&
    IF(LEN(A13)-LEN(SUBSTITUTE(A13," ",))>=1, " "&MID(A13,FIND(" ",A13,1)+1,1),"")&
    IF(LEN(A13)-LEN(SUBSTITUTE(A13," ",))>1," "&MID(A13,FIND(" ",A13,FIND(" ",A13,1)+1)+1,1),""))

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Retrieve 1st Letters from Full Name

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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] Reading the last 2 letters in a combobox value and enter those 2 letters into column
    By emilyloz in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-26-2013, 09:26 AM
  2. Replies: 12
    Last Post: 01-30-2013, 07:32 PM
  3. Removing leading numbers, letters, full stop, and space
    By Hambone70 in forum Excel General
    Replies: 2
    Last Post: 02-16-2011, 01:09 PM
  4. Retrieve last full week in MS Query
    By gjack72 in forum Excel General
    Replies: 0
    Last Post: 08-04-2006, 02:28 PM
  5. How to retrieve full report from Web
    By Calculate Date range in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2006, 06:40 AM

Tags for this Thread

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