+ Reply to Thread
Results 1 to 8 of 8

Need to split cells, trasnpose certain columns to rows in large document

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    4

    Need to split cells, trasnpose certain columns to rows in large document

    I have a document that has about 400 rows of info.

    One cell contains keywords that need to be spit into individual cells. They are delineated by a return. I can do this my turning the text to column.

    This gives me the keywords in their own cells. Which I need.

    I can copy and transpose the new columns into one new column of Keywords. Which I need.

    However each row has two other cells that need to be married to the Keywords that were in the original row. For example :

    Class Code Keywords
    Emergency Medicine EMD1 Blood
    Emergency Medicine EMD1 Sweat
    Emergency Medicine EMD2 Tears
    Primary Care PRI 1 Band Aids

    Is there a faster way to do this? Splitting, copying, transposing, copy/paste again 400 times is a lot. (Maybe I'm lazy.)

    Thanks for your help!I feel like I'm close and just need a little help in the right direction.
    Last edited by BNPalmer; 12-13-2013 at 03:31 PM. Reason: Formatting

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Need to split cells, trasnpose certain columns to rows in large document

    Lazy is the mother of all process improvement.

    Can you give the column order?

    Emergency Medicine EMD1
    • Blood
      Sweat
      Tears

    (without the bullet. vbulletin tables are hard)

    And this needs to become:

    Emergency Medicine EMD1 Blood
    Emergency Medicine EMD1 Sweat
    Emergency Medicine EMD1 Tears

    Is this correct?
    Last edited by daffodil11; 12-13-2013 at 03:44 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

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

    Re: Need to split cells, trasnpose certain columns to rows in large document

    Yes! This is correct.

    Thank for your quick response!

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Need to split cells, trasnpose certain columns to rows in large document

    Do you know the max/min # of keywords?

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

    Re: Need to split cells, trasnpose certain columns to rows in large document

    The min would be 1 the max would be 20.

    Thanks again.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Need to split cells, trasnpose certain columns to rows in large document

    There has to be an easier way, but this was all I could come up with.

    On the first tab I added formulas alongside the data to break out the keywords.

    On the second tab I use another set of formulas to index and return relevant rows, with a column showing True / False.

    Filter by True, select the data, paste the values somewhere else. Tada!

    unconcatenation.xlsx

  7. #7
    Registered User
    Join Date
    12-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to split cells, trasnpose certain columns to rows in large document

    Whoa. This is streets ahead of anything I was messing with.

    THANK YOU and your radioactive mutations!

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Need to split cells, trasnpose certain columns to rows in large document

    No problem. Saw a little hiccup in my formula.

    For some reason I thought you had said 1-8 keywords.

    To adjust stuff, just make sure you drag the formulas on Sheet1 out to Column X

    And then on Sheet2:

    B2: =IF($D2="","",INDEX(Sheet1!A$2:A$3,QUOTIENT(ROW(A1),22)+1))
    C2: =IF($D2="","",INDEX(Sheet1!B$2:B$3,QUOTIENT(ROW(B1),22)+1))
    D2: =IFERROR(INDEX(Sheet1!$E$2:$X$3,QUOTIENT(ROW(B1),20)+1,MOD(ROW(B1),21)),"")

    Essentially, Index takes a range and turns it into a table. I'm then using Quotient and Modulation to divide a naturally incrementing number by a set number to get the integer and/or remainder. The integer +1 is the # of rows down, and the remainder is the # of columns over I go in the table.

    So, imagine A1:C3 a little 3x3 range. My width is 3 columns, so that's my denominator.
    If I paste this little formula into another tab in A1, it pulls 1/3 = (0+1) rows, 1 column = A1 of the index
    2/3 = B1 (0+1) rows, 2 columns
    3/3 = C1 (0+1 rows, 3 columns
    4/3 = A2 (1+1) rows, 1 column
    etc

    In your scenario, we're just using a bigger table and a denominator of 20.

+ 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. Trasnpose multiple columns into two columns
    By learn2excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2013, 09:26 AM
  2. Need help combining multiple rows and columns of data on a large document
    By kernel4485 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-22-2012, 12:53 PM
  3. [SOLVED] How do you split one document into two columns?
    By joanster00 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

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