+ Reply to Thread
Results 1 to 10 of 10

Display text between space X and X from cell.

Hybrid View

carl5156 Display text between space X... 09-03-2010, 05:28 AM
zbor Re: Display text between... 09-03-2010, 05:37 AM
carl5156 Re: Display text between... 09-03-2010, 05:47 AM
zbor Re: Display text between... 09-03-2010, 05:49 AM
carl5156 Re: Display text between... 09-03-2010, 06:20 AM
zbor Re: Display text between... 09-03-2010, 08:25 AM
carl5156 Re: Display text between... 09-03-2010, 09:20 AM
RBEB Re: Display text between... 02-18-2014, 11:57 PM
zbor Re: Display text between... 02-19-2014, 09:05 AM
RBEB Re: Display text between... 02-19-2014, 11:10 PM
  1. #1
    Registered User
    Join Date
    09-03-2010
    Location
    St Helens UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Display text between space X and X from cell.

    Good morning all,

    I'm hoping with all your combined expertise you will be able to help me. I am currently trying to build a formula that will pull text from a cell with between specific amount of spaces.

    Example of what I need...

    "00118385 B L S SL 10G 13 24 29.58 384.54 01/03/2011"
    "00135641 * W C B M CN 133 24 36.21 1194.93 01/03/2011"

    The above is the data entered cells. I require a formula that will pull out the number 13 from the middle of the first example (number 133 from the 2nd), by counting the number of spaces between the text.

    The formula needs to look at the data within the cell from the right, as the number required is always between the 4th and 5th spaces from the right. The info on the left hand side however is variable, and the number of spaces can change from cell to cell. The length of all the information is also interchangable, so unfortunately I can't simply use "=right(len(..."

    I have toyed with 'right(search(" ",' to no avail. I like to think I'm pretty useful with functions, but I think this one is beyond me.

    Hopefully someone can help me!

    Thanks (in advance!!),

    Carl.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: Display text between space X and X from cell.

    MAybe this:

    =--TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)/2)," ",REPT(" ",50)),70))

    Actually, it doesn't look 4th or 5th space from the right but look at the middle of the word...
    So test for all other cases you have and we'll see where it does mistake...
    Last edited by zbor; 09-03-2010 at 05:48 AM.
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    09-03-2010
    Location
    St Helens UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Display text between space X and X from cell.

    Thank you zbor, but I'm not sure where to enter this formula?

    I have a chain of info like the example I gave down column A. Column B is empty but your formula refers to this cell? Obviously I can't paste it into B2 as it creates a circular reference. All I'm getting returned is #VALUE.

    Does this formula contain functions not available in Excel 2003?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: Display text between space X and X from cell.

    I'm sorry, I left the part of my testing.. Try it now...

  5. #5
    Registered User
    Join Date
    09-03-2010
    Location
    St Helens UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Display text between space X and X from cell.

    Unfortunately that only worked for 4 out of 22 of the cells. The other 18 I have all returned #VALUE.

    I've attached a spreadsheet including your forumula, and also other data examples.

    Thanks.
    Attached Files Attached Files

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: Display text between space X and X from cell.

    Here, try this one:

    =LOOKUP(99^99,--LEFT(MID(A2,FIND(CHAR(149),SUBSTITUTE(A2," ",CHAR(149),LEN(A2)-LEN(SUBSTITUTE(A2," ",""))-4))+1,10),10-{9,8,7,6,5,4,3,2,1,0}))
    Last edited by zbor; 09-03-2010 at 08:27 AM.

  7. #7
    Registered User
    Join Date
    09-03-2010
    Location
    St Helens UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Display text between space X and X from cell.

    zbor you legend!!

    You dear Sir, are a god!

    Thank you very much.

  8. #8
    Registered User
    Join Date
    02-18-2014
    Location
    SF, CA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Display text between space X and X from cell.

    zbor - couldn't agree more - this is amazing. What i'm trying to do is quite simple comparatively, but I can't extrapolate from what you created. I have a string of data in a cell that is three numbers, followed by a space, and then a varying number of words. I want to separate the numbers from the varying string of words. For example:

    I have:
    123 Department Black Cat
    and I want:
    "123" in one cell, and "Department Black Cat" in another

    Another example is, I have:
    456 Charming
    and I want
    "456" in one cell, and "Charming" in another.

    do you have ideas / suggestions for this?

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: Display text between space X and X from cell.

    Hi RBEB,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  10. #10
    Registered User
    Join Date
    02-18-2014
    Location
    SF, CA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Display text between space X and X from cell.

    Thanks for the correction zbor! I've re-posted as a stand-alone.

+ 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