+ Reply to Thread
Results 1 to 6 of 6

Extract text from cell with shifting lenghts

  1. #1
    Guest
    Join Date
    05-09-2015
    Location
    Moon
    MS-Off Ver
    MS office 2013
    Posts
    24

    Extract text from cell with shifting lenghts

    Hi much beloved forum!

    I am looking for a way to extract text from a single cell into several other cells. I am currently using find and mid functions but quickly realized that this is not going to work when the lenght of the text is changing. Is this even possible?

    The only thing that is constant is the delimiting "/" and the values in between (5 values).

    Example of series:

    100,1/90,5666/1004/10000/44455

    Which next time might look something like:

    90/10,20/56/4554/112,2

    The ideal result would look something like when each cell has a single value:

    90 in C1
    10,20 in C2
    56 in C3
    4554 in C4
    112,2 in C5

    Any suggestions of how to construct the formula? Or do you have to have 5 separate formulas?

    Best regards,
    Last edited by Sinep D; 07-18-2015 at 11:05 AM.

  2. #2
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Extract text from cell with shifting lenghts

    =trim(mid(substitute(a$1,"/",rept(" ",99)),row(a1)*99-98,99))

  3. #3
    Guest
    Join Date
    05-09-2015
    Location
    Moon
    MS-Off Ver
    MS office 2013
    Posts
    24

    Re: Extract text from cell with shifting lenghts

    Thanks for a very quick reply! I will check and revert!

  4. #4
    Guest
    Join Date
    05-09-2015
    Location
    Moon
    MS-Off Ver
    MS office 2013
    Posts
    24

    Re: Extract text from cell with shifting lenghts

    Truly amazing work and it works like a charm ! Thank you very much!

  5. #5
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Extract text from cell with shifting lenghts

    You're Welcome!

  6. #6
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract text from cell with shifting lenghts

    Quote Originally Posted by Teethless mama View Post
    =trim(mid(substitute(a$1,"/",rept(" ",99)),row(a1)*99-98,99))
    Using ROW(A1) leaves the formula vulnerable to new row insertions.

    Insert a new row 1 and see what happens to the results.

    Using the ROWS() function is more robust.

    =TRIM(MID(SUBSTITUTE(A$1,"/",REPT(" ",99)),ROWS(C$1:C1)*99-98,99))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. VBA to open saved web html pages - extract text - paste text within individual cell
    By EddieRubi in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-23-2015, 01:43 PM
  2. Replies: 4
    Last Post: 08-13-2014, 11:03 PM
  3. [SOLVED] shifting text formula
    By shdwfx in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-27-2014, 02:07 PM
  4. [SOLVED] Extract/Copy Text from Cell, and insert that text in a new row below
    By jamesoneill in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-07-2013, 09:06 AM
  5. VBA Code for cutting character lenghts into another cell
    By ziemann82 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2013, 08:54 AM
  6. Word lenghts and more. Need help!
    By henrybarnett in forum Excel General
    Replies: 2
    Last Post: 06-23-2011, 05:20 AM
  7. Splitting contents of a cell - Diffirent Lenghts
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2009, 07:33 AM

Tags for this Thread

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