+ Reply to Thread
Results 1 to 17 of 17

Formula required for initials of names and combining initials with other text

  1. #1
    Registered User
    Join Date
    07-07-2012
    Location
    India, Pune
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question Formula required for initials of names and combining initials with other text

    Hi Guys,

    I need some help here for making formulas

    1) I want formula For initials Of a name :

    Ilyas Abdul Rauf Shaikh = It should be like this - I A R S (with spaces)

    Ilyas Rauf Shaikh = I R S

    Ilyas R Shaikh = I R S

    Ilyas Shaikh = I S

    Ilyas S = I S

    I Shaikh = I S

    (i want a formula for all above cases)

    2) Second one

    Ilyas Shaikh
    Code - 3FF21GT4123F1WQE

    result should be like this First letter of Ilyas then Code and then last letter of shaikh

    I3FF21GT4123F1WQEH (without Spaces )

    Thanks in advance for help!
    Last edited by iDarkAngel; 07-07-2012 at 03:49 AM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need Formula For Initials of names and combining initials with other text

    Hello & Welcome to the Forum,

    For #1, try this UDF (courtesy norie)

    Please Login or Register  to view this content.
    Select Code >> Open your workbook
    • Alt + F11 >> opens the Visual Basic Editor (VBE)
    • Ctrl + R >> opens the Project Explorer (if not already open on left side of screen)
    • Insert menu >> Module or Alt + I, M >> activates the Insert menu and inserts a Standard Module
    • Paste code >> Ctrl + V (right side of screen)
    • Alt + Q >> exits VBE and returns to Excel
    • With First name in A1 >> B1 =FirstLetters(A1)

    For #2 not so sure, might need some assistance here.

    You only list one name, Ilyas Shaikh, but could it be any of the names above?
    What if the name was Ilyas Abdul Rauf Shaikh?
    What would you want then?

    If it is only two names, a first and a last, try...

    Name in A1 with code in B1
    In C1 >> =LEFT(A1)&B1&UPPER(MID(A1,LEN(A1),1))
    HTH
    Regards, Jeff

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula required for initials of names and combining initials with other text

    surly the second is just upper(left(a1))&code number&upper(right(a1))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    07-07-2012
    Location
    India, Pune
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula required for initials of names and combining initials with other text

    Sir of above VBE codes i have come upto ur second last stage

    I didnt understood your last step

    Please explain

    or do u have formula for it? like for 2nd one??

    Please do reply.


    I have found this formula but it does not create spaces between them

    =IF(LEN(B3)-LEN(SUBSTITUTE(B3," ",""))=0,LEFT(B3,1),IF(LEN(B3)-LEN(SUBSTITUTE(B3," ",""))=1,LEFT(B3,1)&MID(B3,FIND(" ",B3)+1,1),LEFT(B3,1)&MID(B3,FIND(" ",B3)+1,1)&MID(B3,FIND(" ",B3,FIND(" ",B3)+1)+1,1)))
    Last edited by iDarkAngel; 07-07-2012 at 10:27 AM.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula required for initials of names and combining initials with other text

    Hi Martin,

    That would give the first letter of the last name!

    Quote Originally Posted by iDarkAngel View Post
    2) Second one

    Ilyas Shaikh
    Code - 3FF21GT4123F1WQE

    result should be like this
    First letter of Ilyas then Code and then last letter of shaikh

    I3FF21GT4123F1WQEH (without Spaces)

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need Formula For Initials of names and combining initials with other text

    This is the formula, but based off of my assumption its only first name and last name.

    Quote Originally Posted by jeffreybrown View Post
    Name in A1 with code in B1
    In C1 >> =LEFT(A1)&B1&UPPER(MID(A1,LEN(A1),1))
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula required for initials of names and combining initials with other text

    no, right gives last letter in cell =right("Ilyas Rauf Shaikh")= "h"
    Last edited by martindwilson; 07-07-2012 at 10:40 AM.

  8. #8
    Registered User
    Join Date
    07-07-2012
    Location
    India, Pune
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula required for initials of names and combining initials with other text

    Hello mods i m asking for first formula help

    I am unable to do VBE i m poor at it,

    For 1st i found a formula but does not create spaces


    =IF(LEN(B3)-LEN(SUBSTITUTE(B3," ",""))=0,LEFT(B3,1),IF(LEN(B3)-LEN(SUBSTITUTE(B3," ",""))=1,LEFT(B3,1)&MID(B3,FIND(" ",B3)+1,1),LEFT(B3,1)&MID(B3,FIND(" ",B3)+1,1)&MID(B3,FIND(" ",B3,FIND(" ",B3)+1)+1,1)))

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula required for initials of names and combining initials with other text

    Sorry Martin, of course you are right. I was looking at it with blinders on...

    @iDarkAngel,
    Please attach a workbook with your exact requirements. This will help expedite the correct solution.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula required for initials of names and combining initials with other text

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=0,LEFT(A1,1),IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=1,LEFT(A1,1)&" "&MID(A1,FIND(" ",A1)+1,1),LEFT(A1,1)&" "&MID(A1,FIND(" ",A1)+1,1)&" "&MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,1))) but it doesnt work for 4 names
    so use
    =IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=0,LEFT(A1,1),IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=1,LEFT(A1,1)&" "&MID(A1,FIND(" ",A1)+1,1),LEFT(A1,1)&" "&MID(A1,FIND(" ",A1)+1,1)&" "&MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,1)))&IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=3," "&MID(A1,FIND("^",SUBSTITUTE(A1," ","^",3))+1,1),"")
    Last edited by martindwilson; 07-07-2012 at 10:54 AM.

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula required for initials of names and combining initials with other text

    @iDarkAngel,
    Please do not wright in bold, big font, or underline like that again. We are neither deaf nor blind.

    Please Login or Register  to view this content.
    Nobody is asking you to do it or be good at it, it is all done.

    See if this attachment works for you.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-07-2012
    Location
    India, Pune
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula required for initials of names and combining initials with other text

    Heres The File I have written what to do
    Attached Files Attached Files

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula required for initials of names and combining initials with other text

    are you not reading the posts?
    Attached Files Attached Files
    Last edited by martindwilson; 07-07-2012 at 11:10 AM.

  14. #14
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Formula required for initials of names and combining initials with other text

    Please look at post #10. Formula provided by Martin

    Change the cell reference to suit...

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formula required for initials of names and combining initials with other text

    Try this workbook, it uses formulae as requested.
    In C2
    Please Login or Register  to view this content.
    In D2
    Please Login or Register  to view this content.
    This will return up to 6 initials, expand,contract the formula to suit your needs.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  16. #16
    Registered User
    Join Date
    07-07-2012
    Location
    India, Pune
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula required for initials of names and combining initials with other text

    I m sorry for After posts

    I m getting delays in post

    There were no post before

    may be due to bad internet connection

  17. #17
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula required for initials of names and combining initials with other text

    My first and second formulas, forgot to post earlier, sorry if they duplicate any of the previous answers:

    1)
    =LEFT($A1) & MID($A1, FIND(" ", $A1), 2) & CHOOSE(LEN(A1)-LEN(SUBSTITUTE(A1, " ", "")), "", MID($A1, FIND(" ", SUBSTITUTE($A1, " ", "^", 1)), 2), MID($A1, FIND(" ", SUBSTITUTE($A1, " ", "^", 1)), 2) & MID($A1, FIND(" ", SUBSTITUTE(SUBSTITUTE($A1, " ", "^", 1), " ", "^", 1)), 2))


    2) Assumes the name in A1, code in B1:

    =UPPER(LEFT(A1) & B1 & RIGHT(A1))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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