Note: The other languages of the website are Google-translated. Back to English
English English

How to transpose / convert columns and rows into single column?

When you use Excel worksheet, sometimes, you will meet this problem: how could you convert or transpose a range of data into a single column? (See the following screenshots:) Now, I introduce three quick tricks for you to solve this problem.

Transpose/Convert columns and rows into single column with formula

Transpose/Convert columns and rows into single column with VBA code

Transpose/Convert columns and rows into single column with Kutools for Excelgood idea3


Transpose/Convert columns and rows into single column with formula

The following long formula can help you quickly transpose a range of data into a column, please do as this:

1. First, define a range name for your range of data, select the range data that you want to convert, right click and choose Define Name form the context menu. In the New Name dialog box, enter the range name you want. Then click OK. See screenshot:

2. After specify the range name, then click a blank cell, in this example, I will click cell E1, and then input this formula: =INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1).

Note: MyData is the range name of the selected data, you can change it as you need.

3. Then drag the formula down to the cell until the error information is displayed. All the data in the range has been transposed into a single column. See screenshot:


Quickly transpose range to a column/row/ or vice versa in Excel

In some cases, you may need to transpose a range of cells into one column or a row, or vice versa, convert a column or a row into multiple rows and columns in Excel sheet. Do you have any quick way to solve it? Here the Transpose Range function in Kutools for Excel can handle all above jobs easily.Click for free full-featured trial in 30 days!
doc1
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

Transpose/Convert columns and rows into single column with VBA code

With the following VBA code, you can also join the multiple columns and rows into a single column.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module window.

Sub ConvertRangeToColumn()
'Updateby20131126
Dim Range1 As Range, Range2 As Range, Rng As Range
Dim rowIndex As Integer
xTitleId = "KutoolsforExcel"
Set Range1 = Application.Selection
Set Range1 = Application.InputBox("Source Ranges:", xTitleId, Range1.Address, Type:=8)
Set Range2 = Application.InputBox("Convert to (single cell):", xTitleId, Type:=8)
rowIndex = 0
Application.ScreenUpdating = False
For Each Rng In Range1.Rows
    Rng.Copy
    Range2.Offset(rowIndex, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
    rowIndex = rowIndex + Rng.Columns.Count
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

3. Press F5 key to run the code, and a dialog is displayed for you to select a range to convert. See screenshot:

4. Then click Ok, and another dialog is displayed to select a singel cell to put out the result, see screenshot:

5. And click Ok, then the cell contents of the range are converted to a list of a column, see screenshot:

doc-convert-range-to-column11


Transpose/Convert columns and rows into single column with Kutools for Excel

Maybe the formula is too long to remember and the VBA code has some limitation for you, in this situation, please don’t worry, here I will introduce you an easier and more multifunctional tool-Kutools for Excel, with its Transform Range utility, and you can solve this problem quickly and conveniently.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Select the range that you want to transpose.

2. Click Kutools > Transform Range, see screenshot:

doc convert range to column 12

3. In the Transform Range dialog box, select Range to single column option, see screenshot:

doc convert range to column 13

4. Then click OK, and specify a cell to put the result from the pop out box.

doc convert range to column 14

5. Click OK, and the multiple columns and rows data has been transposed into a one column.
doc convert range to column 15

If you want to convert a column to a range with fixed rows, you also can use the Transform Range function to quickly handle it.
doc convert range to column 16


Transpose cross table to list table with Kutools for Excel

If you have a cross table needed to be converted to a list table as below screenshot show, except retyping the data one by one, you also can use Kutools for Excel’s Transpose Table Dimensions utility to quickly convert between cross table and list in Excel.
doc convert range to column 19

After free installing Kutools for Excel, please do as below:

1. Select the cross table you want to convert to list, click Kutools > Range > Transpose Table Dimensions.
doc convert range to column 18

2. In Transpose Table Dimension dialog, check Cross table to list option on Transpose type section, select a cell to place the new format table.
doc convert range to column 18

3. Click Ok, now the cross table has been converted to list.


Related articles:

How to change row to column in Excel?

How to transpose / convert a single column to multiple columns in Excel?

How to transpose / convert columns and rows into single row?


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (58)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Would have been nice to see the full equation in #2.
This comment was minimized by the moderator on the site
NICE! Thanks so much! Saved me tons of time!
This comment was minimized by the moderator on the site
Is there a way to do this but when it grabs the range, it starts from A1 and does all of column A downward, and then grabs Column B and etc?
This comment was minimized by the moderator on the site
Full formula is =INDEX(Range,1+INT((ROW(A1)-1)/COLUMNS(Range)),MOD(ROW(A1)-1+COLUMNS(Range),COLUMNS(Range))+1)
This comment was minimized by the moderator on the site
how did you 'drag the formula to the cell'? I can't drag it from the formula bar.
This comment was minimized by the moderator on the site
I'm using the .xls formula to convert a range of data into one column. I have input the formula as specified with my range name, but I am not clear on 'drag the formula to the cell until the error message appears'. I can't drag the formula anywhere from the formula bar. I'm sure it is user error but can you please help? Thanks
This comment was minimized by the moderator on the site
Thank you very much.
This comment was minimized by the moderator on the site
Your indexing formula was exactly what i needed. Only note is that when copied, there is a "." at the end and Excel doesn't like that. Minor issue.
This comment was minimized by the moderator on the site
thank you:) but how to less 0 value or null on the table or on the name of a range?
This comment was minimized by the moderator on the site
Now I Feel Great........ You Save My 30 Hours Of Work..... Excellent Work.
This comment was minimized by the moderator on the site
The order shown is across-then-down (A1, B1, C1, A2, B2, C2 ...) . I need down-then-across (A1, A2, A3, B1, B2, B3, ...). Is there a way to do that?
This comment was minimized by the moderator on the site
AMAZING! Thank you for posting for the world to benefit from your knowledge!
This comment was minimized by the moderator on the site
Very helpful! Thanks!
This comment was minimized by the moderator on the site
This was a HUGE help!! Thank you so much for posting!!
This comment was minimized by the moderator on the site
Hi guys, I also needed to see down-then-across (a1, a2, a3, b1, b2, b3 etc) instead of across-then-down but that can be done easily by switching the formula to: =INDEX(Range,MOD(ROW(B5)-1+COLUMNS(Range),COLUMNS(Range))+1,1+INT((ROW(B5)-1)/COLUMNS(Range))) Note how the original formula was: =INDEX(Range,1+INT((ROW(A1)-1)/COLUMNS(Range)),MOD(ROW(A1)-1+COLUMNS(Range),COLUMNS(Range))+1) So this was simply a matter of switching parts before and after the comma. Thanks for this thread, helped a lot!
This comment was minimized by the moderator on the site
Thank you very much! It saved my time and it is effective!!!!!!
This comment was minimized by the moderator on the site
thanks.It was very good.
This comment was minimized by the moderator on the site
This formula works better when data is in square format, =INDEX(Range,MOD(ROW(B5)-1+COLUMNS(Range),COLUMNS(Range))+1,1+INT((ROW(B5)-1)/COLUMNS(Range))) but challenge is how to use this formula when data is odd & even Rows & columns and also Dynamic range (Rows or Columns) data. Eg: A1:A5,B1:B4,C1:C6 range of data
This comment was minimized by the moderator on the site
yeah i agree, is this possible if the no. of rows in each column is uneven?
This comment was minimized by the moderator on the site
Thanks it was very much helpful.....
This comment was minimized by the moderator on the site
phewwwwww!!!!! after hours of researching on how to do this GREAT WORK and thanks a lot Kind regards Nathan
This comment was minimized by the moderator on the site
pradeep.kumar@rsrit.com rash@svktechinc.com Akshit kumar7hAkshit kumarHi s to akshith@smtworks.com K. Sandeep Babu {KSB}7hK. Sandeep Babu {KSB} to sandeep.babu@stiorg.com Anup Kumar7hAnup Kumar s on basis to anup@r3tek.com harsha Hemanth6hharsha Hemanth s to hemanth@imbuesys.com sriram rao6hsriram raopls recuirnts to sriram@itcomnce.com Radha Reddy6hRadha Reddy s at radha@infogensoftware.com Raja sekhar Reddy6hRaja sekhar Reddy to raj@prospectinfosys.com This is my data and I need to separate email IDS. Please help how to do it.
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations