+ Reply to Thread
Results 1 to 7 of 7

Extract cells (based on text contained) into left column (left and up) in front of data

  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    3

    Extract cells (based on text contained) into left column (left and up) in front of data

    Hi I have data organised in 1 column in this way:

    acc1
    acc2
    tr1 (summary line)
    acc1
    acc4
    acc5
    acc6
    tr2 (summary line)
    acc2
    acc3
    tr3 (summary line)

    There always is a summary line after group of "acc". However there always is different counts of "acc". The data is downloaded from another application so I can't work with the groups or subtotals. It's raw data.

    And I want to get it shaped into 2 columns like this:

    tr1; acc1
    tr1; acc2
    tr1; tr1 (summary line)
    tr2; acc1
    tr2; acc4
    tr2; acc5
    tr2; acc6
    tr2; tr2 (summary line)
    tr3; acc2
    tr3; acc3
    tr3; tr3 (summary line)

    ...so that the 'summary title' is sitting in the cell left to 'acc' for each 'acc'.

    I would like to avoid filter and copy-paste and fill. I would like to have one easy formula or one easy step.
    Is there some easy step how to do it?
    Thank you.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    16,518

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    16,518

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    Base on your sample with data in A1 down

    in B1

    =SUBSTITUTE(INDEX(A1:A11,MATCH("tr*",A1:A11,0))," (summary line)","")

    in C1

    =A1

    Added file
    Attached Files Attached Files
    Last edited by JohnTopley; 06-25-2017 at 04:38 AM. Reason: Added more info

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    2,819

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    I think in "C1" this : As per John Post file Post #3
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    copy down


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    2007, Office 365
    Posts
    11,592

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    Similar to others. In A1 this and filled down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    1
    tr1;
    acc1
    2
    tr1;
    acc2
    3
    tr1;
    tr1 (summary line)
    4
    tr2;
    acc1
    5
    tr2;
    acc4
    6
    tr2;
    acc5
    7
    tr2;
    acc6
    8
    tr2;
    tr2 (summary line)
    9
    tr3;
    acc2
    10
    tr3;
    acc3
    11
    tr3;
    tr3 (summary line)
    Dave

  6. #6
    Registered User
    Join Date
    01-06-2013
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    Thank you for very easy and quick solution! This is exactly what I was looking for. Great. Thank you. P.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    2007, Office 365
    Posts
    11,592

    Re: Extract cells (based on text contained) into left column (left and up) in front of dat

    Thank you for the feedback and marking this thread SOLVED.

+ 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. Count blank cells right to left where range is based on column header
    By makmood in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-16-2016, 08:18 PM
  2. [SOLVED] Extract text to left of numer
    By cmb80 in forum Excel General
    Replies: 13
    Last Post: 11-05-2014, 12:46 AM
  3. [SOLVED] Extract text to left of nth character
    By cmb80 in forum Excel General
    Replies: 3
    Last Post: 06-16-2014, 11:09 AM
  4. [SOLVED] Extract all text to the left of a hyphen ???
    By burdo77 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-06-2014, 03:54 AM
  5. IF then Insert Column to left based off Text.
    By kinglue in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2013, 11:47 AM
  6. [SOLVED] Extract text left and right of character
    By stuartm4h in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2013, 07:32 AM
  7. Count based on data in column to left
    By Nadir Soofi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2008, 01:40 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