How to Perform Conditional Transpose in Excel – 2 Examples

Download Practice Workbook


The TRANSPOSE Function in Excel

The transpose function converts rows into columns and columns into rows. The basic formula is :

=TRANSPOSE(array)

You have to enter the range of cells as an array and press Ctrl+Shift+Enter (older Excel versions) or Enter (Excel 365).

The sample dataset showcases football players’ information.

Steps:

  • Select a range of cells to paste the formula. (re-arrange the orientation. Here, there are 4 columns: the new array will have 4 rows. There are 5 rows: the new array will have 5 columns.
  • Enter the following formula in B11.
=TRANSPOSE(B4:E9)
  • Press Enter.

Use of Transpose function in Excel

Data is transposed.

  • Add borders.

 


Example 1 – Conditional Transpose of Data for More Than a Number of Rows

The dataset below contains values in a single column.

To transpose that column into a single row with the condition: “transpose the column if there are more than 6 rows”.

 Steps:

  • Select a cell to paste data.
  • Enter the formula:
=IF(COUNTA($B$5:$B$11)>6,TRANSPOSE($B$5:$B$11),"")
  • Press Enter.

Data will be transposed into a new array.

Transpose a column based on condition

The COUNTA Function counts the number of rows in the column.

You can also use the following formula based on the COUNT function for numeric data:

=IF(COUNT($B$5:$B$11)>6,TRANSPOSE($B$5:$B$11),"")

Read More: How to Convert Single Columns to Rows in Excel with Formulas


Similar Readings


Example 2 – Merge an IF Condition While Transposing Data in Excel

This is the transposed dataset in the section “The Transpose Function in Excel

E9 was blank, but in the transposed array the value was set to 0. To avoid this, use conditional transpose:

 Steps:

  • Select a range of cells to paste data. 
  • Enter the formula :
=TRANSPOSE(IF(B4:E9="","",B4:E9))

Conditional Transpose without zero in Excel

 

Read More: How to Transpose a Table in Excel (5 Suitable Methods)


Further Readings

Get FREE Advanced Excel Exercises with Solutions!
A.N.M. Mohaimen Shanto
A.N.M. Mohaimen Shanto

A.N.M. Mohaimen Shanto, a B.Sc. in Computer Science and Engineering from Daffodil International University, boasts two years of experience as a Project Manager at Exceldemy. He authored 90+ articles and led teams as a Team Leader, meticulously reviewing over a thousand articles. Currently, he focuses on enhancing article quality. His passion lies in Excel VBA, Data Science, and SEO, where he enjoys simplifying complex ideas to facilitate learning and growth. His journey mirrors Exceldemy's dedication to excellence and... Read Full Bio

2 Comments
  1. I have a query i have list in column i want to transpose that list in multiple column list is having a blank column so that next transpose set should be in next column if blank cell arises. Very helpfull if you resolve my query.

    • Hi Akhil,

      Unfortunately, there are no direct ways or simple formulas to do that. One way to work around this is to remove the columns as the entirety of them is empty. And then try transposing. Or you can try out VBA to remove the empty columns/rows then try using transpose commands.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo