+ Reply to Thread
Results 1 to 12 of 12

Repeat columns multiple times as rows

  1. #1
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Repeat columns multiple times as rows

    Hi
    I have a spreadsheet that looks as below
    Zone W1 Value Z1 Value ......
    a 100-200 .12 150-300 .13
    b 150-170 .14 170-190 .15
    c 200-300 .17 500-600 .19

    I need to format it so it look like this
    W1 a 100-200 .12
    W1 b 150-170 .14
    W1 c 200-300 .17
    Z1 a 150-300 .13
    Z1 b 170-190 .15
    Z1 c 500-600 .19

    Is there any easy way to make that change.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: Repeat columns multiple times as rows

    Please upload a sample....your column are difficult to read as text above. (but you should be able to make formula using absolute and relative cell references.)

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,708

    Re: Repeat columns multiple times as rows

    Hello AF_Z. Welcome to the forum.

    If you do not know how to upload a file directly to this forum:


    To attach a file to your post: (Please no pics or screenshots ... saves retyping data.),

    be sure to desensitize the data
    • 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”

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

  4. #4
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Re: Repeat columns multiple times as rows

    Thanks I managed to attach a sample file with 3 sheets original_data_1, original_data_2 and Required_Result.
    I am trying to organize the data in the original_data sheets to be the same format as in the Required_result sheet and it
    very hard to do manually as there is a very large amount of data.
    Thanks for your help
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Repeat columns multiple times as rows

    In A2: ="W"&1+INT((ROWS($1:1)-1)/9)

    In B2: ="Zone"&1+MOD((ROWS($1:1)-1),9)

    In C2, drasgged across to D2: =VLOOKUP($B2,Original_Data1!$A:$C,COLUMNS($A:B),FALSE)

    In e2: =VLOOKUP(B2,Original_data_2!$A:$C,3,FALSE)

    Drag down as far as needed.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Re: Repeat columns multiple times as rows

    Amazing! Thank you very much. I guess the only problem and this is my mistake is that the names and zones are more complicated they are not w1,w2 and zone1,zone2. I am attaching a sample with names and zones that change and do not have a pattern.
    Hope this can be done.
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Repeat columns multiple times as rows

    Assuming the zone names are the same on both sheets (you'd changed only on sheet 1):

    =INDEX(Original_Data1!$A$2:$A$10,1+MOD((ROWS($1:1)-1),9))

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Re: Repeat columns multiple times as rows

    Yes they are the same Really Thank you very much!

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Repeat columns multiple times as rows

    Great! glad to help.


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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  10. #10
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Re: Repeat columns multiple times as rows

    I am so sorry but there is still one piece that is not working for me which is the name it is not w1,w2,w3.. it does not have a pattern it goes like e.g w1,x2,z4 as in the attached file.
    I wonder if we can reference it as well.
    Thanks again.
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Repeat columns multiple times as rows

    In A2:

    =INDEX(Original_Data1!$B$1:$F$1,,1+2*INT((ROWS($1:1)-1)/9))
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-31-2019
    Location
    EGYPT
    MS-Off Ver
    2016
    Posts
    6

    Re: Repeat columns multiple times as rows

    Great! Thank you again very much

+ 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] Repeat value from cell: X times with interval of Y rows
    By ISMI in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-24-2017, 12:49 PM
  2. [SOLVED] Repeat formula X times - once X times has been achieved then Y - repeat X again
    By jonnym28 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-25-2015, 11:53 AM
  3. Macro to repeat rows a certain amount of times (loop)
    By jadore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2014, 10:46 PM
  4. [SOLVED] Transposing columns and known rows multiple times
    By aprcamb in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-06-2013, 03:55 AM
  5. Need macro help with transposing columns to rows and repeat a row value multiple times
    By InnovativeAJ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 11:53 AM
  6. Replies: 17
    Last Post: 04-05-2009, 07:27 PM
  7. [SOLVED] Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec
    By unibaby in forum Excel General
    Replies: 2
    Last Post: 08-24-2005, 12:05 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