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
Convert vector / single row or column to matrix with formulas
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:
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:
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:
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.
Convert vector / single row or column to matrix with Kutools for Excel
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.
After installing Kutools for Excel, please do with following steps:
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.
4. Then click Ok button, a prompt box will pop out to remind you select a cell to output the result, see screenshot:
5. And then click OK, the single column has been converted to a matrix you need, see screenshot:
Download and free trial Kutools for Excel Now !
Related article:
How to convert matrix to vector or single column in Excel?
Best Office Productivity Tools
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!