+ Reply to Thread
Results 1 to 8 of 8

Transpose Multiple Columns into a Single Row

  1. #1
    Registered User
    Join Date
    09-15-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Transpose Multiple Columns into a Single Row

    I've seen a few threads appear with this question but I feel that they may have been mislabeled; I am not trying to condense multiple rows into one long row; instead, I need to transpose multiple columns into one long row.

    For example, I have the data

    A1 A2 A3 A4
    B1 B2 B3 B4
    C1 C2 C3 C4
    D1 D2 D3 D4


    And I need it to display like this:

    A1 B1 C1 D1 A2 B2 C2 D2 A3 B3 C3 D3 A4 B4 C4 D4


    Any assistance would be very helpful. Thanks in advance!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Transpose Multiple Columns into a Single Row

    how many exactly is that a true representation of your data?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,645

    Re: Transpose Multiple Columns into a Single Row

    Something like this?
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Transpose Multiple Columns into a Single Row

    for 4 columns
    =INDEX(A:D,CEILING(ROWS($A$1:A1)/4,1),MOD(ROWS($A$1:A1)-1,4)+1)

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Transpose Multiple Columns into a Single Row

    although the suggestion by popipipo works there is an error in the first 4 rows
    =INDEX($A$1:$D$53,INT((ROW()-0.5)/7)+1,ROW()-INT((ROW()-0.5)/7)*7)
    should be
    =INDEX($A$1:$D$53,INT((ROW()-0.5)/4)+1,ROW()-INT((ROW()-0.5)/4)*4)

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,645

    Re: Transpose Multiple Columns into a Single Row

    I saw that later.
    Row 1 to 4 I forgot to correct it, but from row 5 it is ok

  7. #7
    Registered User
    Join Date
    09-15-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Transpose Multiple Columns into a Single Row

    Quote Originally Posted by martindwilson View Post
    how many exactly is that a true representation of your data?
    Sorry; I should have clarified further. The example I included is representative insofar as there are indeed 4 rows of data. The ideal solution, however, could be used for any number of columns. Popipipo, I have had success with your approach. Thanks very much the same to everyone else who contributed!
    Last edited by gabevece; 09-15-2013 at 07:33 PM.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Transpose Multiple Columns into a Single Row

    5 columns would be
    =INDEX(A:E,CEILING(ROWS($A$1:A1)/5,1),MOD(ROWS($A$1:A1)-1,5)+1)
    6 columns
    =INDEX(A:F,CEILING(ROWS($A$1:A1)/6,1),MOD(ROWS($A$1:A1)-1,6)+1)
    7 columns say G:M

    =INDEX(G:M,CEILING(ROWS($A$1:A1)/7,1),MOD(ROWS($A$1:A1)-1,7)+1)
    and so on
    Last edited by martindwilson; 09-15-2013 at 07:29 PM.

+ 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 Multiple Rows into a Single Column
    By vnascimento in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2013, 08:47 AM
  2. Replies: 5
    Last Post: 05-25-2013, 07:12 AM
  3. Replies: 4
    Last Post: 01-14-2011, 09:30 PM
  4. Transpose multiple text-based columns to single column while retaining record ids
    By SchoobsVT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2010, 12:26 PM
  5. [SOLVED] Transpose Multiple Columns to Single Row
    By whicks in forum Excel General
    Replies: 7
    Last Post: 02-06-2006, 01:30 PM

Tags for this Thread

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