Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Transpose a Matrix in Excel: Step-by-Step

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To transpose a matrix in Excel, you swap its rows and columns. The quickest reliable way is to copy the range, then use Paste Special > Transpose. For a live result that updates when the source changes, use the TRANSPOSE function (in Microsoft 365 and Excel 2021 it spills automatically; in older versions you enter it as an array formula with Ctrl+Shift+Enter). Both methods work on any rectangular block of cells, and neither changes the original data.

What You'll Need

  • Excel for Windows, Mac, or the web (the Paste Special and TRANSPOSE options are available in all current versions; exact menu labels can differ slightly by version and platform).
  • A rectangular range of cells containing your matrix. Transposing works on any size, but the destination needs enough empty cells to the right and below the paste point.
  • For the TRANSPOSE function: a version of Excel that supports dynamic arrays (Microsoft 365, Excel 2021, Excel for the web). Older versions need the array-formula method described below.

Step-by-Step

Method 1: Paste Special > Transpose (static copy)

  1. Select the entire matrix you want to transpose, including headers if you have them. For example, if your data is in A1:C4, select A1:C4.
  2. Press Ctrl+C (Windows) or Command+C (Mac) to copy the range. A moving dashed border appears around it.
  3. Click the single cell where the transposed matrix should start. Choose a location that has enough empty space to the right and below it — the transposed matrix will be as wide as the original was tall, and as tall as the original was wide.
  4. Right-click the destination cell and choose Paste Special. On the Paste Special dialog, tick the Transpose checkbox and click OK. (On Excel for the web, use Home > Paste > Transpose from the Paste dropdown.)
  5. Check the result: the first row of the original is now the first column, and the first column is now the first row. Press Esc to clear the copy border.

This method creates a one-time copy. If you later edit the original matrix, the transposed copy does not update.

Method 2: The TRANSPOSE function (live result)

  1. Click the top-left cell of an empty area large enough to hold the transposed matrix.
  2. Type =TRANSPOSE( and then select the original range, or type its address, for example =TRANSPOSE(A1:C4).
  3. Close the parenthesis and press Enter. In Microsoft 365, Excel 2021, and Excel for the web, the result spills automatically into the surrounding cells — no need to select the whole output area first.
  4. In older Excel versions without dynamic arrays, select the full output range first (same number of rows as the source has columns and vice versa), type the formula, then press Ctrl+Shift+Enter instead of Enter. Excel wraps the formula in braces to mark it as an array formula.
  5. Edit any cell in the original range and the transposed result updates automatically, because it is linked by formula.

If a spilled TRANSPOSE formula returns a #SPILL! error, the output area is not empty. Clear the cells below and to the right of the formula, or move the formula to a clear area.

Common Mistakes

  • Pasting over existing data. Transpose does not warn you before overwriting cells. Always paste into an empty area, or use a new sheet.
  • Selecting a non-rectangular range. Transpose requires a rectangular block. If your selection includes blank rows or merged cells, the result can be misaligned or fail. Unmerge cells first.
  • Expecting the copy to stay linked. Paste Special > Transpose is a static copy. Use TRANSPOSE if you need the result to follow changes in the source.
  • Forgetting the array entry in older Excel. Pressing Enter instead of Ctrl+Shift+Enter on a pre-dynamic-array version returns only the first value, not the full matrix.
  • Transposing formulas with relative references. When you transpose formulas, relative references shift. Check the results; if references break, convert the formulas to values first (copy, then Paste Special > Values) before transposing.
  • Pasting into a protected sheet or a table. Transpose can fail on protected worksheets and inside Excel Tables. Paste outside the table or unprotect the sheet first.

Tips

  • Use Paste Special > Transpose for a quick one-off flip, and TRANSPOSE when the source data will keep changing.
  • To transpose and keep formatting, use Paste Special and choose the Transpose option with the formatting paste choice, or paste normally first and then transpose values.
  • If you only need to swap rows and columns visually, you can also use Power Query: load the range, then use Transform > Transpose. This is useful for large or recurring jobs.
  • Name your source range (Formulas > Define Name) so the TRANSPOSE formula reads clearly, for example =TRANSPOSE(SalesData).
  • After transposing, check that headers still line up with their data — a transposed header row becomes a header column, which is easy to misread.

Troubleshooting

  • The Transpose option is greyed out. You are probably not in a pasteable state — recopy the range, make sure you are not editing a cell, and confirm the sheet is not protected.
  • The result is only one cell. In older Excel, the formula was entered without Ctrl+Shift+Enter, or the output range was not selected first. Redo it as an array formula.
  • #SPILL! error. The spill area is blocked. Clear the cells below and to the right, or move the formula.
  • #VALUE! error. The range contains text where a number is expected in a calculation, or the range is not rectangular. Check for merged cells and stray text.
  • Formatting looks wrong after pasting. Paste Special > Transpose copies values and formulas but not always all formatting. Repaste with formatting options, or reformat the result.
  • Data looks shifted by one row or column. The source selection probably included an extra blank row or column. Reselect the exact data block and repeat.

Frequently Asked Questions

Does transposing change my original data?

No. Both Paste Special > Transpose and the TRANSPOSE function leave the source range untouched; they only create a new arrangement elsewhere.

Can I transpose a matrix that contains formulas?

Yes, but relative references shift when the formulas move. If the results look wrong, convert the formulas to values before transposing.

Why does my TRANSPOSE formula show only one value?

In Excel versions without dynamic arrays, TRANSPOSE must be entered as an array formula: select the full output range, type the formula, and press Ctrl+Shift+Enter.

Is there a limit to the size I can transpose?

The limit is the worksheet size itself: the transposed result must fit within the available rows and columns, and the destination area must be empty.

Can I transpose on Excel for the web?

Yes. Copy the range, then use Home > Paste > Transpose, or use the TRANSPOSE function, which spills in Excel for the web.

What is the difference between Transpose and Power Query Transpose?

Paste Special > Transpose is a one-time copy; the TRANSPOSE function stays linked to the source; Power Query Transpose is best for repeated or large transformations and refreshes with the query.