+ Reply to Thread
Results 1 to 9 of 9

Thread: Extract the last word from the cell

  1. #1
    Registered User
    Join Date
    12-31-2011
    Location
    West Bengal
    MS-Off Ver
    Excel 2007
    Posts
    48

    Extract the last word from the cell

    Dear all,

    Please help me to extract the last word from the cells of a certain column.

    File attached

    Senjuti
    Attached Files Attached Files
    Last edited by senjuti.sarkar; 02-10-2012 at 03:47 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,209

    Re: Extract the last word from the cell

    Here, try this:

    =TRIM(RIGHT(SUBSTITUTE(B2," ",REPT(" ",255)),150))
    "Relax. What is mind? No matter. What is matter? Never mind!"

  3. #3
    Valued Forum Contributor
    Join Date
    12-03-2009
    Location
    Firenze, Italy
    MS-Off Ver
    Excel 2000 XP
    Posts
    436

    Re: Extract the last word from the cell

    Hi,

    try:

    =TRIM(RIGHT(SUBSTITUTE(B2," ",REPT(" ",100)),50))
    Regards

    Edit: Sorry Zbor: same answer. Regards
    Attached Files Attached Files
    Last edited by CANAPONE; 02-10-2012 at 03:05 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon below the post.

    Please, mark your thread [SOLVED] if you received your answer.

    Forum rules: http://www.excelforum.com/forum-rule...rum-rules.html

  4. #4
    Registered User
    Join Date
    12-31-2011
    Location
    West Bengal
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Extract the last word from the cell

    IT WORKED TO WELL
    Thanks a lot,
    But how could I remove the space coming in the resulting cell?

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,209

    Re: Extract the last word from the cell

    How do you mean? There is no space in resulting cell.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  6. #6
    Registered User
    Join Date
    12-31-2011
    Location
    West Bengal
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Extract the last word from the cell

    But in mine sheet its resulting with a space in front.
    Attached Files Attached Files

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,209

    Re: Extract the last word from the cell

    That's because you don't have spaces but some other characters.

    Here, this should work for you:

    =TRIM(RIGHT(SUBSTITUTE(B2,CHAR(160),REPT(" ",255)),150))


    Edit: but that won't work for other data...

    In that case first copy one character from your result that is not trimed.
    Select B column and replace (ctrl+H) that character with space.

    Then it will work.
    Last edited by zbor; 02-10-2012 at 03:38 AM.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,209

    Re: Extract the last word from the cell

    Other option with one formula is this:

    =TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(B2,CHAR(160)," ")," ",REPT(" ",255)),150))
    "Relax. What is mind? No matter. What is matter? Never mind!"

  9. #9
    Registered User
    Join Date
    12-31-2011
    Location
    West Bengal
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Extract the last word from the cell

    ohh....its nicely worked ..thanks Zbor.

    Regards
    Senjuti

+ 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.2.0