• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

extract name & initial

Kcprakash

New Member
Dear friend,
Kindly give solution to the following problem
prakash=Prakash
K.Prakash =Prakash.k
k.c.prakash=Prakash.k.c
k.c.p.prakash=Prakash.k.c.p
the extraction should be one formula and not with vba code
 
it appears your username is incorrect...lol

welcome.... going to need more info. is Prakash the only last name?
 
I assume your list in in A2:A5
In A2: =IFERROR(RIGHT(A2,LEN(A2)-2*(LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))&"."&LEFT(A2,2*(LEN(A2)-LEN(SUBSTITUTE(A2,".","")))-1),A2)
Copy down
 
Hi Kcprakash,

I'm not sure whether there are some typo's in your example where initials should be in uppercase, but if there are then you could add to @Hui 's formula with the PROPER() function

=IFERROR(PROPER(RIGHT(A2,LEN(A2)-2*(LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))&"."&LEFT(A2,2*(LEN(A2)-LEN(SUBSTITUTE(A2,".","")))-1)),PROPER(A2))
 
or more correctly
=PROPER(IFERROR(RIGHT(A2,LEN(A2)-2*(LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))&"."&LEFT(A2,2*(LEN(A2)-LEN(SUBSTITUTE(A2,".","")))-1),A2))
 
Ok, here's a bad boy for you:

=PROPER(IFERROR(IF(LEN(A2)-FIND(CHAR(135),SUBSTITUTE(A2,".",CHAR(135),LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))=1,A2,RIGHT(A2,LEN(A2)-2*(LEN(A2)-LEN(SUBSTITUTE(A2,".",""))))&"."&LEFT(A2,2*(LEN(A2)-LEN(SUBSTITUTE(A2,".","")))-1)),A2))
 
Back
Top