TRUNCATEMATRIX
Description
Removes rows, columns, or both, from a matrix.
Syntax
TRUNCATEMATRIX(
matrix
,
rows
, [
columns
])
- matrix: The source matrix to truncate.
- rows: The number of rows in the output matrix. If you specify zero, the output matrix will have the same number of rows as the input matrix.
- columns: The number of columns in the output matrix. If you specify zero or you don't specify a value, the output matrix will have the same number of columns as the input matrix.
Example
Formula | Result |
|---|---|
=TRUNCATEMATRIX({1,2,3;4,5,6;7,8,9}, 2, 2 ) | 1 2
4 5
|
Notes
- This function returns a matrix that is a result of removing rows and/or columns from the input matrix, essentially cropping the input matrix to a new set of dimensions.
- This function is intended for use in array formulas.