+ Reply to Thread
Results 1 to 5 of 5

Separate last two words and put in a separate column

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Separate last two words and put in a separate column

    Hi All,

    I am new to this forum. Also, I am thankful to this forum. I was not able to find apt solution for the problem posted. e.g. "Tanmayi Ispat Pvt Ltd Hyderabad SE 2B" I want to separate last words "SE 2B" and put in a separate column. Then Separate "Hyderabad" and put in another coulumn. The fields are Industry name, City and Rating (SE 2B here).

    Kindly help.

    Regards,
    Adi

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Separate last two words and put in a separate column

    Assuming the words is in Cell A1.


    =TRIM(LEFT(RIGHT(" "&SUBSTITUTE(TRIM(A1)," ",REPT(" ",30)),80),30))

    and

    =MID(A1,FIND("@",SUBSTITUTE(A1," ","@",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1))+1,255)

    ***
    try also this

    =TRIM(LEFT(RIGHT(" "&SUBSTITUTE(TRIM(A1)," ",REPT(" ",60)),120),60)) -> SE only
    =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1))) -> 2B only
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Separate last two words and put in a separate column

    Hi...This may be helpful
    1) Last word =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",50)),50))
    2) 2nd last word =TRIM(LEFT(RIGHT(SUBSTITUTE(" "&TRIM(A1)," ",REPT(" ",50)),100),50))
    3) 3rd last =TRIM(LEFT(RIGHT(SUBSTITUTE(" "&TRIM(A1)," ",REPT(" ",50)),150),50))

  4. #4
    Registered User
    Join Date
    09-11-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Separate last two words and put in a separate column

    Thanks a lot.

    This was really useful. Now If I need to have the Industry name also in the column.

    It will read "Tanmayi Ispat Pvt Ltd" "Hyderabad" "SE 2B" in 3 columns.

    Now how to remove the city and Rating portion and get the industry name.

    Note : All industry name have different string length.

    e.g. The other ones "Technoweld Hyderabad SE 3B" and "Telecanor Global Ltd Hyderabad SME 1"

    Regards,
    Adi

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Separate last two words and put in a separate column

    try

    =TRIM(LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-2))))

+ 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