TRIMRANGE
Trims empty rows and columns from the edges of a range.
- Excel: Verified match
- Google Sheets: No equivalent
- Returns: Array
Examples
=TRIMRANGE(A1:C10) | A | B | C | |
|---|---|---|---|
| 1 | 10 | 2 | alpha |
| 2 | 20 | 4 | beta |
| 3 | 30 | 6 | gamma |
| 4 | 40 | 8 | delta |
| 5 | 50 | 10 | epsilon |
Result 10
Syntax
TRIMRANGE(range, [trim_rows], [trim_cols]) range- range required
trim_rows- number optional
trim_cols- number optional
Related
ARRAY_CONSTRAINTruncates a range to at most the given rows and columns. ARRAYFORMULAEvaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility). ARRAYTOTEXTConverts array to text representation. BYCOLApplies lambda to each column of array. BYROWApplies lambda to each row of array. CHOOSECOLSReturns the specified columns from an array.