+ Reply to Thread
Results 1 to 5 of 5

Trouble extracting partial text from cell contents

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    3

    Trouble extracting partial text from cell contents

    Hi all,

    I've been battling with this on and off for a while, but its time to wave the white flag and ask for help....

    I have a cell containing 4 lines of text (well 7 when you include spacer lines), i am trying to get the last line into a cell by itself but keep hitting issues that i cant quite identify.

    I have included an image of the formula i have so far in operation, and a workbook with it in use.

    example1.jpg

    i can see it is almost working but i have no idea why it is not starting at the Char(10) that its looking for? but rather sometimes a few characters before and sometimes after. i believe it is doing what i tell it to, just clearly i cant tell it to do the right thing!

    Also, this is the potentially deadended rout i have gone down, if i have missed a more obvious way to do things i am more than happy to go with something that will work!

    Please help

    Dean
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trouble extracting partial text from cell contents

    Try

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

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Trouble extracting partial text from cell contents

    Jonmo1 - It is my understanding that "255" represents character spaces from the right. I tried this on a project that I am working on...works great!!

    My question, what if my character spaces vary. Meaning I need to pull/return information that is different and their could be spaces within whats needed, example; West Virginia or Virginia.
    My data does have a constant, it is the > symbol. Is there a way in the formula to return only the data to the right of that symbol?
    Example: Cable Assemblies > Copper Cable Assemblies > Lighting Cable Assemblies
    My return needs to be "Lighting Cable Assemblies"

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Trouble extracting partial text from cell contents

    if you have "Cable Assemblies > Copper Cable Assemblies > Lighting Cable Assemblies" in cell A1 then try the jonmo1 formula with little change
    =TRIM(RIGHT(SUBSTITUTE(a1,">",REPT(" ",255)),255))
    otherwise change the A1 according to your needs
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Registered User
    Join Date
    04-24-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Trouble extracting partial text from cell contents

    nflsales - Thank you, this worked great !!!
    Last edited by Waycool86; 03-10-2015 at 12:45 PM. Reason: duplication

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to return a cell's contents if it contains partial text
    By d dubya in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-02-2014, 11:51 PM
  2. [SOLVED] Look up Partial Cell contents
    By AlexKen in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-05-2012, 03:43 PM
  3. Extracting partial information from a Cell/s
    By hammer2 in forum Excel General
    Replies: 4
    Last Post: 02-09-2012, 12:12 AM
  4. Sort by the partial contents of a cell
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2011, 03:11 PM
  5. matching partial text within one cell to partial text within another
    By Solstice in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 03-03-2010, 09:13 PM

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