Lookup and reference functions
TRANSPOSE
Matches all 7 recorded answers
Recorded: 7 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | TRANSPOSE |
| Bulgarian | TRANSPOSE |
| Czech | TRANSPOZICE |
| Danish | TRANSPONER |
| German | MTRANS |
| Greek | TRANSPOSE |
| English (Australia) | TRANSPOSE |
| English (United Kingdom) | TRANSPOSE |
| English (United States) | TRANSPOSE |
| Spanish | TRANSPONER |
| Estonian | TRANSPOSE |
| Finnish | TRANSPONOI |
| French | TRANSPOSE |
| Hebrew | TRANSPOSE |
| Croatian | TRANSPOSE |
| Hungarian | TRANSZPONÁLÁS |
| Indonesian | TRANSPOSE |
| Italian | TRASPONI |
| Japanese | TRANSPOSE |
| Korean | TRANSPOSE |
| Lithuanian | TRANSPOSE |
| Latvian | TRANSPOSE |
| Norwegian | TRANSPONER |
| Dutch | TRANSPONEREN |
| Polish | TRANSPONUJ |
| Portuguese (Brazil) | TRANSPOR |
| Portuguese (Portugal) | TRANSPOR |
| Romanian | TRANSPOSE |
| Russian | ТРАНСП |
| Slovak | TRANSPOSE |
| Slovenian | TRANSPOSE |
| Serbian (Latin) | TRANSPOSE |
| Swedish | TRANSPONERA |
| Thai | TRANSPOSE |
| Turkish | DEVRİK_DÖNÜŞÜM |
| Ukrainian | TRANSPOSE |
| Vietnamese | Hàm TRANSPOSE |
| Chinese (Simplified) | TRANSPOSE |
| Chinese (Hong Kong) | TRANSPOSE |
| Chinese (Traditional) | TRANSPOSE |
Names from Microsoft's support site.
What it does
TRANSPOSE(array)
TRANSPOSE exchanges an array's axes. For an m × n input A, the result B is n × m
with
B[j, i] = A[i, j] for all i ∈ 1..m, j ∈ 1..n
That is the complete definition, and it is one of the very few worksheet functions whose
mathematics is exactly the mathematics of the same-named operation in linear algebra. A row
becomes a column, a column becomes a row, and a rectangle turns on its side. No values change,
none are added or removed, and the operation is its own inverse:
TRANSPOSE(TRANSPOSE(A)) = A.
The historical importance of TRANSPOSE is out of proportion to its simplicity. Before dynamic
arrays it was one of the very few functions whose natural result was an array, which made it
the standard teaching example for Ctrl+Shift+Enter array entry — you had to select the target
rectangle first, with the dimensions swapped, before committing the formula. On a modern Excel
it simply spills, and that entire ritual is gone.
Arguments
TRANSPOSE(array) — exactly one argument, required, no options.
array — the range or array to transpose. A reference is admissible and is resolved to its
values; unlike OFFSET or ROW, TRANSPOSE has no interest in the address.
The only thing regularly misunderstood about the argument is what comes back: readers who pass a single column expect a single column with a different orientation on screen, which is exactly what they get, and readers who pass a rectangle sometimes expect a rotation rather than a transposition. Transposition is a reflection across the main diagonal, not a 90-degree rotation: the top-left element stays put, and the anti-diagonal order is not reversed.
Try it
Quirks
Result and edge cases
The return kind is an array with the input's dimensions exchanged.
- Values are moved, not interpreted. Errors, text, logicals and blanks all survive
transposition unchanged.
TRANSPOSEdoes not coerce. - What happens to blanks is the one genuine question. A blank cell in a range has no value
of its own, and the general model says
Emptyis admitted at the raw-return boundary but not at the published-result boundary, normalizing to zero on the way out (the value universe). A transposed blank cell that publishes as0is therefore expected behaviour under the shared model rather than aTRANSPOSEquirk — but the Handbook has not verified it for this function. - A 1×1 input transposes to a 1×1 array, and must remain array-shaped.
- A single-row or single-column input is the common case and exercises none of the interesting index arithmetic; a rectangular input does.
- Very large arrays hit the grid limits at publication.
- Dynamic-array publication and
#SPILL!are host-side adaptation, described in the call pipeline.
Errors
Microsoft's page for TRANSPOSE does not enumerate error conditions, which is consistent with
a total function on arrays: every rectangular array has a transpose.
The errors a reader meets in practice come from elsewhere — #SPILL! when the swapped
dimensions do not fit, #VALUE! on a legacy grid when an array result was not array-entered,
and whatever error values were already inside the array and are simply carried across.
How to implement
Notes for implementers
- The operation is index arithmetic and nothing else. Any implementation that copies values through a coercion step is doing more than the function asks and can only introduce divergence.
- Row-major storage makes transposition a strided copy; for large arrays the cache behaviour differs sharply between the naive and the blocked implementation, but the result must not.
TRANSPOSEis an excellent test instrument for other functions precisely because it is exact and self-inverse:TRANSPOSE(TRANSPOSE(f(x))) = f(x)is a metamorphic check that needs no oracle.- Blank handling should follow the engine's general empty-cell rule rather than acquiring a local convention.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
TRANSPOSE · 1 lines · calc-func/src/catalogue/host_facts.rs on GitHub8 transpose_fn "TRANSPOSE" (1, 1) [R "array"] |s, a, sv| { transpose(s, a, sv) }
transpose · 26 lines · calc-func/src/catalogue/host_facts.rs on GitHubfn transpose(site: &Site<'_>, a: &[CalcValue], sv: &mut EvalServices<'_>) -> Step<CalcValue> {
let g = grid(site, a, 0, sv)?;
if !g.held {
return Ok(a[0].clone());
}
let mut rows = Vec::with_capacity(g.cols);
for c in 0..g.cols {
let mut row = Vec::with_capacity(g.rows);
for r in 0..g.rows {
let value = g.cells[r * g.cols + c].clone();
// A blank cell transposes as 0, as an array formula over a blank cell gives.
row.push(if matches!(value.core_ref(), CoreRef::Empty) {
CalcValue::number(0.0)
} else {
value
});
}
rows.push(row);
}
if rows.len() == 1 && rows[0].len() == 1 {
return Ok(rows.remove(0).remove(0));
}
CalcArray::from_rows(rows)
.map(CalcValue::array)
.ok_or_else(|| site.not_modelled(None))
}
Argument and result plumbing
gridcatalogue/kit
No implementation has been published with a Handbook test suite for this function.
Version differences
No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.
Alternatives
Relationships
TOCOL/TOROWflatten rather than transpose; the pair are related byTOROW(x, i, s) = TRANSPOSE(TOCOL(x, i, s)), which makesTRANSPOSEthe bridge between the two flattening directions.VSTACK/HSTACKare similarly related through transposition:HSTACK(a, b) = TRANSPOSE(VSTACK(TRANSPOSE(a), TRANSPOSE(b))).MMULT,MINVERSE,MDETERMare the rest of the matrix family;TRANSPOSEis the one member that is pure index arithmetic with no floating-point content, and therefore the one member with no accuracy question at all.- Paste Special ▸ Transpose is the destructive command form: it writes values, does not
recompute, and is what
TRANSPOSEreplaces for live data. WRAPROWS/WRAPCOLSreshape rather than reflect; a reader wantingm × nfromn × mdata in a different element order wants those, not this.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents