TRIMRANGE
Scans in from the edges of a range or array until it finds a non-blank cell (or value), it then excludes those blank rows or columns.
Lookup & ReferenceLookup & Matching EssentialsModern Excel Functions
What it does
Removes trailing/leading empty cells from a dynamic array reference.
Syntax
TRIMRANGE(range, [trim_option])
Arguments
range(range) β The range.trim_option(number) β 0=Both, 1=Leading, 2=Trailing.
Examples
Trim Range
Remove empty end rows.
FORMULA
=TRIMRANGE(A1:A5)
RESULT
[1; 2]
SAMPLE DATA
| A | |
|---|---|
| 1 | Data |
| 2 | 1 |
| 3 | 2 |
| 4 | |
| 5 | |
| 6 |