Forum Discussion

kaystephen's avatar
kaystephen
Copper Contributor
Jun 13, 2019
Solved

Easy way to move column headings to row labels?

I have imported data from a survey that lists the questions in the top row as individual columns and the data from respondents in individual rows. Is there an easy way to swap these so that the questions run down the side of the sheet as row labels and the data from each respondent is arranged in a separate column? I haven't been able to find a quick way (other than cut and paste which is untenable for a survey with dozens of questions and about 350 respondents. Thanks in advance for suggestions. 

  • kaystephen 

    The operation you have described is transposing the dataset.  The formula that will do this is

    = TRANSPOSE( data )

    but the formula must be committed with ctrl+shift+enter as an array.

     

    You could alternatively perform the task manually using Cut and Paste transposed.

     

    Power Query will transpose data as well as promoting and demoting headers to the first row of data.

     

    Another formula that is capable of reversing rows and columns is INDEX in which a column number is read from a helper range ( or calculated from COLUMN() ) and then used as the row index in the function.  Take your choice.

     

3 Replies

  • kaystephen's avatar
    kaystephen
    Copper Contributor

    Thanks for the quick responses! It took me a couple of tries because the data set is large, but TRANSPOSE worked with your help. 

  • kaystephen 

    The operation you have described is transposing the dataset.  The formula that will do this is

    = TRANSPOSE( data )

    but the formula must be committed with ctrl+shift+enter as an array.

     

    You could alternatively perform the task manually using Cut and Paste transposed.

     

    Power Query will transpose data as well as promoting and demoting headers to the first row of data.

     

    Another formula that is capable of reversing rows and columns is INDEX in which a column number is read from a helper range ( or calculated from COLUMN() ) and then used as the row index in the function.  Take your choice.

     

  • Manf1976's avatar
    Manf1976
    Copper Contributor

    Hi kaystephen - Have you tried Transpose

     

    Copy the data from the sheet, create a new sheet then in cell A1 right click and hit the transpose paste option

     

Resources