Skip to content

TRANSPOSE

Flips a range so rows become columns and columns become rows. In current Excel the result spills and stays linked to the source.

Syntax

=TRANSPOSE()

Lookup and reference

Every version of Excel, but how you enter it differs. In Excel for Microsoft 365, Excel 2021 and later, a normal formula spills into the cells it needs. In Excel 2019 and earlier, select the whole output range first and confirm with Ctrl+Shift+Enter.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
D
E
F
G
1
Month
Flipped
2
Jan
Jan
Feb
Mar
Apr
3
Feb
4
Mar
5
Apr
6

C2 =TRANSPOSE(A2:A5) returns Jan, Feb, Mar, Apr

How TRANSPOSE works

TRANSPOSE turns a range on its side. A column of 12 months becomes a row of 12 months, and a block with 3 rows and 5 columns becomes a block with 5 rows and 3 columns. The first row of the source becomes the first column of the result.

The argument

array is the range or array to flip. It can be a cell range, an array constant or the output of another formula, such as =TRANSPOSE(SORT(A2:A9)).

How it behaves

In Microsoft 365 and Excel 2021 or later, TRANSPOSE is an ordinary formula. Type it in the top-left cell where you want the result, press Enter, and the result spills into as many cells as it needs. If something is in the way, you get #SPILL!.

In Excel 2019 and earlier, TRANSPOSE has to be entered as an array formula. Select a range of exactly the flipped size (a source of 3 rows by 5 columns needs a 5-by-3 output), type the formula, and confirm with Ctrl+Shift+Enter. A range that is too small cuts off the result, and one that is too big fills the extra cells with #N/A.

Linked, not copied

The result is a live formula. When a source value changes, the transposed copy changes with it. That separates TRANSPOSE from Paste Special > Transpose, which pastes static values and does not update. Use Paste Special when you want a one-off flip you can edit freely, and TRANSPOSE when the result must follow the source.

Because the output of a spill is one formula, you can't edit or delete individual cells inside it. To change it, edit the formula in the top-left cell, or delete that cell to clear the whole result.

Empty cells become zero

If a source cell is empty, the transposed cell shows 0, not a blank. The fix is to test for blanks in the source before flipping, for example =TRANSPOSE(IF(A1:A5="","",A1:A5)), which turns empty cells into empty text.

Uses beyond layout

TRANSPOSE is also a building block inside other formulas. A vertical list of values can be paired with a horizontal list of weights: =SUMPRODUCT(B2:B4, TRANSPOSE(B7:D7)) multiplies each score by its weight, because both are now three items tall. It is also the usual way to feed a row to a function that expects a column, such as a lookup range.

Other functions can reshape data too. INDEX pulls one row or column out of a block, and in Microsoft 365, TOCOL and TOROW flatten a block into one column or row.

Arguments

array
The range or array to flip, such as A1:A12 or A1:D3. The first row of the result is the first column of the source, and so on.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Turn a column into a row

C2 =TRANSPOSE(A2:A5)

Result: Jan, Feb, Mar, Apr

The four-row column becomes a four-column row, spilling right from C2. Cells C2:F2 must be empty.

C2
A
B
C
D
E
F
G
1
Month
Flipped
2
Jan
Jan
Feb
Mar
Apr
3
Feb
4
Mar
5
Apr
6

C2 =TRANSPOSE(A2:A5) returns Jan, Feb, Mar, Apr

Example 2

Flip a table: 2 rows by 3 columns becomes 3 by 2

E2 =TRANSPOSE(A1:C3)

Result: Region, North, South; Q1, 48200, 31750; Q2, 51400, 33100

The header row becomes the first column. The three-by-three block stays square here, but each row of the source is now a column of the result.

E2
A
B
C
D
E
F
G
1
Region
Q1
Q2
Flipped table
2
North
48200
51400
Region
North
South
3
South
31750
33100
Q1
48200
31750
4
Q2
51400
33100
5
6

E2 =TRANSPOSE(A1:C3) returns Region, North, South; Q1, 48200, 31750; Q2, 51400, 33100

Example 3

Empty cells come through as zero

C2 =TRANSPOSE(A1:A4)

Result: Jan, Feb, 0, Apr

A3 is empty, so the third result shows 0, not a blank. Use IF(A1:A4="","",A1:A4) inside TRANSPOSE to keep it blank.

C2
A
B
C
D
E
F
1
Jan
Flipped
2
Feb
Jan
Feb
0
Apr
3
4
Apr
5

C2 =TRANSPOSE(A1:A4) returns Jan, Feb, 0, Apr

Example 4

Pair a column of scores with a row of weights

B8 =SUMPRODUCT(B2:B4,TRANSPOSE(B6:D6))

Result: 7.6

The scores run down a column and the weights run across a row. TRANSPOSE turns the weights into a column, so SUMPRODUCT can multiply them item by item: 8 x 0.5 + 6 x 0.3 + 9 x 0.2.

B8
A
B
C
D
E
1
Criterion
Score
2
Quality
8
3
Price
6
4
Delivery
9
5
6
Weights
50%
30%
20%
7
8
Weighted score
7.6
9

B8 =SUMPRODUCT(B2:B4,TRANSPOSE(B6:D6)) returns 7.6

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In F2, flip the four months in A2:A5 into a row.

Answer in F2.

F2
A
B
C
D
E
F
G
H
1
Month
Months as a row
2
Jan
3
Feb
4
Mar
5
Apr
6
7
Quarters down the side
8
Region
Q1
Q2
Q3
9
North
48,200
51,400
49,800
10
South
31,750
33,100
35,200
11
12

Common mistakes

  • The result spills, so the cells it needs must be empty. Anything in the way gives #SPILL!.
  • Empty source cells come through as 0. Wrap the source in IF(range="","",range) if you want blanks to stay blank.
  • You can't edit part of a spilled result. Change the formula in the top-left cell, or use Paste Special > Transpose if you need editable static values.
  • In Excel 2019 and earlier you must select an output range of the exact flipped size and confirm with Ctrl+Shift+Enter. Too small a range cuts the result off, and too large fills extra cells with #N/A.
  • Formatting doesn't travel with the result. Apply number formats and column widths to the output cells yourself.

Questions people ask

What is the difference between TRANSPOSE and Paste Special > Transpose?

TRANSPOSE is a formula, so the flipped copy updates when the source changes and can't be edited cell by cell. Paste Special > Transpose pastes static values and formats that you can edit freely, but it doesn't update.

Why does TRANSPOSE return #SPILL!?

Something is in the way of the area the result needs. Clear the cells to the right and below the formula, or move the formula to an area with room.

Why does TRANSPOSE show 0 for blank cells?

Empty source cells are returned as zero. Use `=TRANSPOSE(IF(A1:A5="","",A1:A5))` to keep them blank.

How do I use TRANSPOSE in Excel 2019?

Select a range with the flipped dimensions, type the formula, and press Ctrl+Shift+Enter. A source of 3 rows by 5 columns needs an output of 5 rows by 3 columns.

Learn TRANSPOSE in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.