Contact

Zoho Sheet TRIMRANGE: Remove empty outer rows and columns

Text Intermediate Zoho Sheet

Use TRIMRANGE in Zoho Sheet with explicit leading and trailing modes, complete blank-cell grids and preserved interior gaps.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: TRIMRANGE removes fully empty rows and columns at the outside of a range. It keeps empty gaps inside the remaining rectangle. In the complete example below, =TRIMRANGE(A1:E6) retains B2:D5, a 4×3 rectangle.

Syntax and modes

=TRIMRANGE(range; [trim_rows]; [trim_columns])

Both optional modes default to 3. For each axis, 0 disables trimming, 1 trims the leading edge, 2 trims the trailing edge, and 3 trims both. Leading means top for rows and left for columns; trailing means bottom and right. Official TRIMRANGE reference.

The source range is the boundary of the operation. Occupied cells elsewhere on the worksheet do not enlarge the range supplied in the formula. The operation returns a trimmed range or array; it is not an instruction to delete worksheet rows or shift the original cells.

Create an explicit dataset

Start with A1:E6 genuinely empty. Enter only these six values, leaving every other cell in that rectangle unused:

Cell Value
B2 Item
D2 Amount
B3 Pen
D3 10
B5 Pad
D5 20

The complete layout is:

Row A B C D E
1 blank blank blank blank blank
2 blank Item blank Amount blank
3 blank Pen blank 10 blank
4 blank blank blank blank blank
5 blank Pad blank 20 blank
6 blank blank blank blank blank

Here “blank” means a genuinely unused cell, not a cell containing that word, a space or a formula returning empty text.

Work through the default result

Enter =TRIMRANGE(A1:E6) in a separate empty result area. Independent geometry gives the retained source rectangle B2:D5:

Result row Column 1 Column 2 Column 3
1 Item blank Amount
2 Pen blank 10
3 blank blank blank
4 Pad blank 20

Top row 1, bottom row 6, left column A and right column E are empty exterior edges. Interior row 4 and column C remain. Removing those internal gaps would be a different operation.

The table describes retained content and shape, not a verified native blank-display format. Zoho array-entry, automatic expansion and blocked-result handling have not been tested in an authored workbook for this guide.

Control one edge at a time

Use the same unchanged source grid for every comparison:

Formula Independent retained source rectangle Shape
=TRIMRANGE(A1:E6;3;3) B2:D5 4×3
=TRIMRANGE(A1:E6;1;0) A2:E6 5×5
=TRIMRANGE(A1:E6;2;0) A1:E5 5×5
=TRIMRANGE(A1:E6;0;1) B1:E6 6×4
=TRIMRANGE(A1:E6;0;2) A1:D6 6×4
=TRIMRANGE(A1:E6;0;0) A1:E6 6×5

A row-only operation retains empty columns because the column mode is zero. Likewise, trimming only the right edge leaves the empty left column in place. This makes the modes useful when a layout intentionally reserves a margin on one side.

Practical use: clean a padded report block

When a source export includes a blank border around a table, the default operation can isolate the occupied rectangle while preserving intentional spacing within it. In this example, the gap between Pen and Pad remains visible, as does the blank middle column. That can be preferable to compressing the data into a different layout.

Keep the original source block so the returned rectangle can be audited. If you need to remove all empty rows throughout a dataset, TRIMRANGE’s documented exterior-only behavior does not satisfy that request. TRIM works on text whitespace and is a different function despite the shared word “trim.”

Blanks, errors and limits

The cited article does not define whether a formula returning "", whitespace text or an error-valued cell counts as empty for this operation. The worked fixture therefore uses actual unused cells. Do not replace them with visually similar formulas and assume the same geometry.

The generic error table does not establish exact errors for unsupported mode values, an entirely empty input, malformed arrays or destination conflicts. Use the documented integer modes 0–3 and a range containing real data. Official limits and examples.

Availability and evidence scope

The rolling official article was checked October 18, 2026. Expected rectangles are independently derived from the complete grid and documented modes. No authored Zoho execution or screenshot is claimed. Introduction release, mobile parity and historical retirement status are not established by the sources.