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

How to convert vector / single row or column to matrix in Excel?

How could you convert a single row or column to a range of matrix in Excel? Copy and paste them one by one will waste a lot of time, in this article, I will talk about some quick tricks for you to solve this job.

Convert vector / single row or column to matrix with formulas

Convert vector / single row or column to matrix with Kutools for Excel


You can apply the following formulas to convert a row or a column to matrix, please do as follows:

Convert a single column to matrix:

Supposing, I have a column of values C1:C20, and now, I want to convert this column to a matrix with four rows and five columns (4×5), please do as follows:

1. Enter this formula into a blank cell, F1 for example: =OFFSET($C$1:$C$20,COLUMN()-COLUMN($F$1)+((ROW()-ROW($F$1))*(ROWS($C$1:$C$20)/4)),0,1,1),and then press Enter key to get the first value, see screenshot:

doc convert vector to matrix 1

Note: In the above formula:

$C$1:$C$20: is the column data that you want to convert to matrix;

$F$1: indicates the cell where you want to put the first result of matrix;

ROWS($C$1:$C$20)/4: the number 4 is the number of rows that you want in the resulting matrix. If you want to matrix with two rows, you just need to change the 4 to 2.

You can change the above cell references to your need.

2. Then drag the fill handle down to 4 rows, and then go on dragging it to right 5 columns, and you will get the following result:

doc convert vector to matrix 2

Convert a single row to matrix:

To convert a single row to a matrix with five rows and four columns (5×4), please use the following formula:

Enter this formula into a blank cell, E4, for example: =OFFSET($A$1:$T$1,0,COLUMN()-COLUMN($E$4)+(ROW()-ROW($E$4))*(COLUMNS($A$1:$T$1)/5),1,1), then drag the fill handle down to five rows and then drag it to right four columns to get a matrix with five rows and four columns as following screenshot shown:

doc convert vector to matrix 3

Note: In the above formula:

$A$1:$T$1: is the row data that you want to convert to matrix;

$E$4: indicates the cell where you want to put the first result of the matrix;

COLUMNS($A$1:$T$1)/5: the number 5 is the number of rows that you want in the resulting matrix. If you want to matrix with two rows, you just need to change the 5 to 2.

You can change the above cell references to your need.

If there are blank cells in the original column or row, they will be displayed as 0 in the matrix.


The above formulas may be somewhat difficult for most of Excel beginner, here, I can introduce you a handy tool- Kutools for Excel, with its Transform Range utility, you can quickly convert a single row or column to a range and vice versa.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days

After installing Kutools for Excel, please do with following steps:( Free Download Kutools for Excel Now )

1. Select the column or row data that you want to convert.

2. Then click Kutools > Range > Transform Range, see screenshot:

3. In the Transform Range dialog box:

(1.) To convert single row to a matrix, please select Single row to range from the Transform type, to convert single column to matrix, select Single column to range;

(2.) Specify the number of columns that you want to convert in the Fixed value box under Rows per record, if you type 5, you will get a matrix with 5 columns.

doc convert vector to matrix 5

4. Then click Ok button, a prompt box will pop out to remind you select a cell to output the result, see screenshot:

doc convert vector to matrix 6

5. And then click OK, the single column has been converted to a matrix you need, see screenshot:

doc convert vector to matrix 7

Click to know more details about this Transform Range utility…

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Download and free trial Now!

Related article:

How to convert matrix to vector or single column in Excel?


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 (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you so much!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations