+ Reply to Thread
Results 1 to 17 of 17

Moving Repeating Data from Rows to Columns (Not Transpose)

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Moving Repeating Data from Rows to Columns (Not Transpose)

    Any idea how can I achieve this layout result?
    Maximum sequence will be 7 columns.
    Need your support on this with same formula or easy way to do it (not VBA) since I have around 20k of results to transpose like sample attached
    Capture.PNG
    Last edited by sepmir1; 05-11-2017 at 07:57 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    I always use VBA for this. I've attached a workbook you can use. Drop your data into columns A:C, it's important your column B have those sequence numbers as we are using those to determine how big the output array needs to be. Click the button and it will give you an new output sheet in your consolidated format.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Million thanks JBeaucaire,

    Works perfectly!!! Tkx


    Unfortunately I am not a VBA wizard and situation likes this comes to me in regular basis.
    Quick question: if I want more than 3 columns which variable should I change in code?

    Additionally… Do you know how to do it with formulas 

    Once again, thank you for your support.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Don't understand the ramifications of the "quick question".

    Additionally, no, I use VBA for this.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    sepmir1 welcome to the forum.
    Additionally… Do you know how to do it with formulas
    I'd be happy to work a formula solution. If you upload a brief sample workbook (rather than screen shot) it will save having to retype the data. About 30 rows should be enough.

    If you are not familiar with how to do this:

    To attach a file to your post,
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”
    • be sure to desensitize the data

    The file name will appear at the bottom of your reply.
    Dave

  6. #6
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    We are from diferent countries so "quick question" in PT we assume... "easy answer".
    No worries mate I understand should be easy thru VBA.
    Tkx

  7. #7
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Thank you FlameRetired

    Attached you can found a sample file.
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Although the unique IDs can be returned by formula the simplest way is to copy / paste IDs from column A to the output range (column F?) then remove duplicates.

    That is what I have done in the attached. Then array enter this formula in G3 fill down and across until you get blanks. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Although the unique IDs can be returned by formula the simplest way is to copy / paste IDs from column A to the output range (column F?) then remove duplicates.

    That is what I have done in the attached. Then array enter this formula in G3 fill down and across until you get blanks. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit I just re read post #1.
    I have around 20k of results to transpose like sample attached
    This solution might not be so good. Array formulas are resource hungry and that is a lot of rows. I will keep working on alternate solution.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    This version should be an improvement. Please let me know how it does on your real data.
    This does not have to be array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    I'm confused. The data given in the file from post #7 would work perfectly if pasted into the VBA workbook I provided, one button. Just copy the data only and paste into row 2 downward. When you try it, are the results not as expected?

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    I made one small tweak to correct the output title row.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Don't be confused JBeaucaire.
    Your solution works perfectly. Better would be impossible.

    However, since I'm not an experienced VBA user I am looking for conventional alternatives using excel formulas.
    FlameRetired is available to waste some time seeking a solution through formulas, which I appreciate.

  14. #14
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Quote Originally Posted by FlameRetired View Post
    This version should be an improvement. Please let me know how it does on your real data.
    This does not have to be array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    FlameRetired - you are the one! This solution is outstanding!!!
    In fact JBeaucaire code is easier than yours but your tip also fix my problem and works like a charm
    Of course need some same changes but those I can do from here.

    Million thanks for your support and dedication.

  15. #15
    Registered User
    Join Date
    10-21-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    Quote Originally Posted by JBeaucaire View Post
    I made one small tweak to correct the output title row.
    JBeaucaire,

    What a fantastic solution. All results as expected.
    FlameRetired did some tuning in to initial formula and touch the point: was exactly what I need.
    You have the best solution but VBA is not my expertize.

    Thank you for your support.

  16. #16
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  17. #17
    Registered User
    Join Date
    10-15-2019
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Moving Repeating Data from Rows to Columns (Not Transpose)

    JBeaucaire,

    I'm getting a Run-time error '9':
    Subscript out of Range

    I've attached a sample dataset with 3 items. There will be over 100 items.

    Thank you.
    Attached Files Attached Files

+ 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] Moving Repeating Data from Rows to Columns (Not Transpose)
    By mifac in forum Excel General
    Replies: 6
    Last Post: 07-30-2021, 04:08 PM
  2. [SOLVED] Need help on macro to transpose rows to columns while repeating certain column N times
    By cmleong in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2016, 11:07 PM
  3. [SOLVED] Transpose Columns to Rows While Repeating Data in First Column to Each Row
    By leoxanigm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2015, 06:54 AM
  4. Replies: 7
    Last Post: 02-05-2015, 03:20 PM
  5. transpose data from columns into rows
    By levycraig in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2010, 07:26 AM
  6. Data in columns to rows (not transpose...)
    By titus.hanke in forum Excel General
    Replies: 13
    Last Post: 12-01-2008, 09:43 AM
  7. Transpose data from rows into columns
    By greaseman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2006, 03:52 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