Skip to main content

How to convert matrix style table to three columns in Excel?

Author Xiaoyang Last modified

Supposing you have a matrix-style table which contains column headings and row headings, and now you would like to convert this style table to three columns table, it also called list table as following screenshot shown, do you have any good ways to solve this problem in Excel?

Convert matrix style table to list with PivotTable

Convert matrix style table to list with VBA code

Convert matrix style table to list with Kutools for Excel

A screenshot showing a matrix-style table converted to a three-column list in Excel


Convert matrix style table to list with PivotTable

In Excel, there isn’t a direct feature for us to convert the matrix style table to three columns table, but, if you are familiar with PivotTable, it may do you a favor. Please do with the following steps:

1. Activate your worksheet which you want to use, then holding Alt + D, and then press P in the keyboard, in the popped out PivotTable and PivotChart Wizard dialog, select Multiple consolidation ranges under the Where is the data that you want to analyze section, and then choose PivotTable under the What kind of report do you want to create section, see screenshot:

A screenshot of the PivotTable and PivotChart Wizard - Step 1 of 3 dialog

2. Then click Next button, in the Step 2a of 3 wizard, select the I will create the page fields option, see screenshot:

A screenshot of the PivotTable and PivotChart Wizard - Step 2a of 3 dialog

3. Go on clicking Next button, in the Step 2b of 3 wizard, click 5 button to select the data range that you want to convert, and then click Add button to add the data range to the All ranges list box, see screenshot:

A screenshot of the PivotTable and PivotChart Wizard - Step 2b of 3 dialog

4. And click Next button, in Step 3 of 3 wizard, select a location for the pivot table as you want.

A screenshot of the PivotTable and PivotChart Wizard - Step 3 of 3 dialog

5. Then click Finish button, a pivot table has been created at once, see screenshot:

A screenshot of the pivot table created in Excel from a matrix-style table

6. In the pivot table, double click intersecting cell of the Grand Total, in this case, I will double click the cell F22, and it will generate a three columns table as following screenshot shown:

A screenshot of the table generated by double-clicking the Grand Total cell to convert the matrix into a three-column list

7. And finally, you can convert the table format to the normal range by selecting the table and then choose Table > Convert to Range from the context menu, see screenshot:

A screenshot showing the Convert to Range option for turning the pivot table into a standard list


Convert matrix style table to list with VBA code

If you don’t like the first method, the following VBA code also can help you.

1. Press Alt + F11 to display the Microsoft Visual Basic for Applications window.

2. In the window, click Insert > Module to show a new module window, then copy and paste the following VBA code into the module window.

Sub ConvertTable()
'Update 20150512
Dim Rng As Range
Dim cRng As Range
Dim rRng As Range
Dim xOutRng As Range
xTitleId = "KutoolsforExcel"
Set cRng = Application.InputBox("Select your Column labels", xTitleId, Type:=8)
Set rRng = Application.InputBox("Select Your Row Labels", xTitleId, Type:=8)
Set Rng = Application.InputBox("Select your data", xTitleId, Type:=8)
Set outRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
Set xWs = Rng.Worksheet
k = 1
xColumns = rRng.Column
xRow = cRng.Row
For i = Rng.Rows(1).Row To Rng.Rows(1).Row + Rng.Rows.Count - 1
    For j = Rng.Columns(1).Column To Rng.Columns(1).Column + Rng.Columns.Count - 1
        outRng.Cells(k, 1) = xWs.Cells(i, xColumns)
        outRng.Cells(k, 2) = xWs.Cells(xRow, j)
        outRng.Cells(k, 3) = xWs.Cells(i, j)
        k = k + 1
    Next j
Next i
End Sub

3. Then press F5 key to run this code, and a prompt box pops out to let you select the column labels of the data, see screenshot:

A screenshot of a prompt to select column labels

4. And then click OK button, in the next prompt box, select the row labels, see screenshot:

A screenshot showing the selection of row labels

5. Go on clicking OK, then select the data range excluding the column and row headings in the prompt box, see screenshot:

A screenshot of the prompt to select the matrix data range

6. And then click OK, in this dialog box, please select a cell where you want to locate the result. See screenshot:

A screenshot showing the selection of the output cell for the converted three-column list

7. At last, click OK, and you will get a three columns table at once.


Convert matrix style table to list with Kutools for Excel

Both of the above methods are somewhat troublesome, here, I will introduce you an easy way -- Kutools for Excel, with its Transpose Table Dimensions feature, you can quickly convert betwwen a matrix of cells and a list table.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please do as following steps:

1. Click Kutools > Range > Transpose Table Dimensions, see screenshot:

A screenshot of the Transpose Table Dimensions option on the Kutools tab on the ribbon

2. In the Transpose Table Dimensions dialog box:

(1.) Choose Cross table to list option under Transpose type.

(2.) And then click Range selection icon button under Source range to select the data range that you want to convert.

(3.) Then click Range selection icon button under Results range to select a cell where you want to put the result.

A screenshot of the Transpose Table Dimensions dialog

3. And then click OK button, and you will get the following result which including the original cell formatting:

A screenshot of the result after using Kutools for Excel to convert a matrix table to a three-column list

With this utility, you also convert flat list table to 2-dimensional cross table.

To know more about this Transpose Table Dimensions feature.

Download and free trial Kutools for Excel Now !


Demo: Convert matrix style table to list with Kutools for Excel

Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!