+ Reply to Thread
Results 1 to 6 of 6

Transpose but need to create duplicate rows

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    10

    Transpose but need to create duplicate rows

    Hi all,

    I have a set of data, hundreds of lines for 1 week period. I need to easily change the original data to the way that it lists it in each row. Please find atatched excel sheet to understand what i mean.

    So it needs to create duplicate of column1 5 times and then tranpose the rest of the other rows.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Transpose but need to create duplicate rows

    using your sample file, the below will show one way of doing this using your sample data / ranges etc

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


    the range references that pertain to columns A:F would need to be adjusted to reflect your real data (rows etc), whilst the references to likes of I3 etc should be updated to reflect wherever you choose to recreate your data.

    you can probably achieve the same using a multi consolidation pivot table route but tbh the above is relatively lightweight to do with calcs... similarly it would be straightforward to code, if required.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Transpose but need to create duplicate rows

    You can use the formulae below in the cells stated:

    A12: =INDEX($A:$A,INT((ROWS($1:1)-1)/5)+3)

    B12: =INDEX($B$2:$F$2,MOD(ROWS($1:1)-1,5)+1)

    C12: =INDEX($B:$F,INT((ROWS($1:1)-1)/5)+3,MOD(ROWS($1:1)-1,5)+1)

    Then copy down as far as you need to.

    Hope this helps.

    Pete

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Transpose but need to create duplicate rows

    in A12
    =INDEX($A$2:$F$4,QUOTIENT((ROW()-12)+1,6)+1+1,1)
    in B12
    =INDEX($B$2:$F$2,1,MOD((ROW()-12),5)+1)
    in C12
    =INDEX($B$3:$F$4,QUOTIENT((ROW()-12)+1,6)+1,MOD((ROW()-12),5)+1)
    and copy down the columns

    This is based on your test data, expand the INDEX() range for your proper data.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Transpose but need to create duplicate rows

    edit: I just tested the multi consolidation pivot, and it would be pretty quick -- steps to do this:

    on sheet holding data to be transposed...

    1. hold ALT press D then P
    2. select Multiple Consolidation Ranges
    3. click Next
    4. in Range dialog click Arrow and select your range (A2:F4), and click little arrow in box to return to main dialog
    5. click Finish
    6. double click on Grand Total (57)

    you will now have your transposed dataset.

  6. #6
    Registered User
    Join Date
    01-26-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Transpose but need to create duplicate rows

    Quote Originally Posted by XLent View Post
    edit: I just tested the multi consolidation pivot, and it would be pretty quick -- steps to do this:

    on sheet holding data to be transposed...

    1. hold ALT press D then P
    2. select Multiple Consolidation Ranges
    3. click Next
    4. in Range dialog click Arrow and select your range (A2:F4), and click little arrow in box to return to main dialog
    5. click Finish
    6. double click on Grand Total (57)

    you will now have your transposed dataset.
    Hi XLent

    This works great. Thanks very much, saves me a lot of time as this is a weekly thing i need to do with hundreds of lines

+ 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. transpose duplicate rows to columns
    By slabbbe in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-01-2021, 06:11 PM
  2. [SOLVED] Transpose duplicate rows to columns
    By micheale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2018, 02:15 AM
  3. [SOLVED] How to transpose duplicate rows to columns
    By triade in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2017, 01:03 PM
  4. Transpose duplicate rows into columns
    By Ochenden in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2016, 03:44 PM
  5. Transpose Duplicate Rows to Separate Columns
    By VEL in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-26-2012, 01:08 PM
  6. Transpose and create duplicate names
    By light in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-03-2011, 04:42 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