+ Reply to Thread
Results 1 to 12 of 12

How to separate last combine characters which is separated by space

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    How to separate last combine characters which is separated by space

    CELLA2:A Having below data
    Please Login or Register  to view this content.
    i want like in the cell B2:B as following

    Please Login or Register  to view this content.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: How to separate last combine characters which is separated by space

    hi nur2544, try:
    =MID(A2,FIND("^",SUBSTITUTE(A2," ","^",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))+1,LEN(A2))

    copy down

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: How to separate last combine characters which is separated by space

    Try pasting this into cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: How to separate last combine characters which is separated by space

    Hi,benishiryo
    it works fine, but the problem is that when it gets blank cell or others value then it returns #VALUE!, how to remove it.
    i have tried like below but results goes to "SS 1B" "CLASS 2B" "CLASS 2AC"
    Please Login or Register  to view this content.
    Last edited by nur2544; 02-06-2013 at 11:45 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: How to separate last combine characters which is separated by space

    Hello nur2544

    You can turn off the #VALUE! in options. Otherwise try this formula in cell B2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: How to separate last combine characters which is separated by space

    hi mc84excel
    It works fine , although i get puzzle to see the big formula !. i always love small formula. as my requirement is fulfillment so i am going to use this..
    how ever i have another post would you please look, here is the link
    http://www.excelforum.com/excel-form...cell-b1-b.html
    Last edited by nur2544; 02-07-2013 at 12:31 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: How to separate last combine characters which is separated by space

    Quote Originally Posted by nur2544 View Post
    hi mc84excel
    i get puzzle to see the big formula !
    The secret to creating an impressively big formula is to work out what you want to achieve, break it down into small individual tasks and then work out the formulas for each task. Once you have all the small formulas working correctly, you copy and paste these little formulas into one big formula.


    I'll explain how I solved your question:

    First off, I had the formula I provided in my first post
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This formula will return the last word in a cell taken from the last " " in the string.

    However you didn't want the #VALUE! message to appear. (This was because the cell had no " " spaces in it so the formula I supplied couldn't calculate). So I had to determine if the target cell had no " "s in it. I wrote this formula to return the number of " "s appearing in the target cell:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As I expected, this formula returns an error if there are no " " in the target cell. I then altered this formula to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    (By using ISERR, the cell displays TRUE if the calculation will result in an error). So we now had a quick way of testing if the previous formula would show #VALUE!


    Now all I had to do was to combine both of these formulas into one single formula by means of an IF statement:


    IF (enter the ISERR formula above to determine if cell has no " ") =TRUE then return "". If not then (enter the formula to find last word in cell).
    Thus:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    I hope this helps to explain how the big formula was worked out.



    (Actually I could have used: =IF(ISERR(original formula),"",(original formula)) However I wanted to give you a smaller formula so I used the FIND " " formula for the ISERR check instead).
    Last edited by mc84excel; 02-07-2013 at 02:33 AM. Reason: clarify post

  8. #8
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: How to separate last combine characters which is separated by space

    Hi

    Another simple one!
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  9. #9
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: How to separate last combine characters which is separated by space

    Quote Originally Posted by Kevin UK View Post
    Hi

    Another simple one!
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Much smaller formula. I like it! (Just don't use it if the cell contains more than 100 spaces, right?)

  10. #10
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: How to separate last combine characters which is separated by space

    hi mc84excel
    Excellent explanation, many thanks….

  11. #11
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: How to separate last combine characters which is separated by space

    @ mc84excel

    Why not! Put 200 space's between each word, then use the formula.

    Quote Originally Posted by mc84excel View Post
    Much smaller formula. I like it! (Just don't use it if the cell contains more than 100 spaces, right?)

  12. #12
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: How to separate last combine characters which is separated by space

    Hi, Kevin UK
    Thanks for discovering very smallest formula. It also works fine. however I appreciate all of you as it is not any issue at all as I know very well that everyone having deferent Logic & method , I am trying to learn how it can be done different way , and for this all of your logic Method I prefer . Thanks all of you who has given there valuable time for me . Take care..

    @ benishiryo .total number of characters of the formula are 85
    Please Login or Register  to view this content.
    @ mc84excel .total number of characters of the formula are 119
    Please Login or Register  to view this content.
    @ Kevin UK .total number of characters of the formula are 49
    Please Login or Register  to view this content.

+ 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