TRIMRANGE
trims empty rows and columns from the edges of a range · from excel · excel: verified match · no sheets equivalent
signature
TRIMRANGE(range, [trim_rows], [trim_cols])
returns: array
| argument | required |
|---|---|
| range | required |
| trim_rows | optional |
| trim_cols | optional |
examples
formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.
| A | B | C | |
|---|---|---|---|
| 1 | 10 | 2 | alpha |
| 2 | 20 | 4 | beta |
| 3 | 30 | 6 | gamma |
| 4 | 40 | 8 | delta |
| 5 | 50 | 10 | epsilon |
fx
=TRIMRANGE(A1:C10) 10 related
- ARRAY_CONSTRAIN truncates a range to at most the given rows and columns
- ARRAYFORMULA evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
- ARRAYTOTEXT converts array to text representation
- BYCOL applies lambda to each column of array
- BYROW applies lambda to each row of array
- CHOOSECOLS returns the specified columns from an array