Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to convert crosstab table (2-dimensional table) to list in Excel?

Do you know how to convert a cross table (two dimensional table) to a list table (one dimensional table) in Microsoft Excel? For some reasons, you may need to convert a table (with row headings and column headings) to a flat list in Excel. The following tricks can help you convert a cross table to flat list easily and quickly:


Supposing you have a cross table and need to convert it to a list as follows.

Cross table (with row headings and columns headings) A list table (one dimensional table)

arrow blue right bubble Convert cross table to list in Excel with VBA

The following VBA macro can help you quickly convert all cross tables in active worksheet to flat lists.

Step 1: Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert > Module, and paste the following macro in the Module Window.

The VBA on transpose crosstab table to list:

Sub ConvertTableToList()
Const TEST_COLUMN As String = "A"
Dim i As Long, j As Long
Dim iLastRow As Long
Dim iLastCol As Long
Application.ScreenUpdating = False
With ActiveSheet
iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 2 Step -1
iLastCol = .Cells(i, .Columns.Count).End(xlToLeft).Column
For j = iLastCol To 3 Step -1
.Rows(i + 1).Insert
.Cells(i + 1, 2).Value = .Cells(i, j).Value
.Cells(i, j).Value = ""
Next j
Next i
.Rows(1).Delete
End With
Application.ScreenUpdating = True
End Sub

Step 3: Click the F5 key to run this macro.

Then you will see the converted list showing as following screenshot:

Note:

1. This VBA macro loses some data of original table, such as headers, or others. In this case, the headers (Name, Grade, and Class) are lost.

2. You can change As String = "A", to meet your need. For example, if the cross table is stated in Column E, you should instead "E" of "A".

3. And if there are other data in the worksheet, sometimes the data in the list will be wrong after converting a cross table.


arrow blue right bubble Convert cross tables to lists in Excel with Kutools for Excel

If you have Kutools for Excel installed, you can use its Transpose Table Dimensions tool to convert cross tables to flat list quickly.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Get it Now.

Step 1: Select the table which you will convert it to a list.

Step 2: Click the Kutools >Modify > Transpose Table Dimension. See the following screen shot:

Step 3: In Transpose Table Dimensions dialog box, check the Cross table to list option, and select the Results range with clicking the button.

Step 4: Click OK button.

Then you will see the original table is converted into a flat list as following screenshot:

Transpose Table Dimensions also can convert list to crosstab table. For more information, please go to Transpose Table Dimensions.


Relative articles:


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Rowan · 2 years ago
    Thanks for the code, I translated very large tables into lists without any issues, worked a charm.
  • To post as a guest, your comment is unpublished.
    Chris · 2 years ago
    Brilliant! Kutools does the trick. Awesome guys thank you.
  • To post as a guest, your comment is unpublished.
    Erin Dalton · 3 years ago
    THANK YOU!! Your macro worked perfectly. I'll use your link if I choose to purchase KuTools.