TRIMRANGE Function in Excel: Cut Empty Edges Off a Range

⏱ 1 min readUpdated 28 September 2026

Dynamic ArrayLevel: ExpertAvailable in: Excel 365 / 2021+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Related functions

TRIMRANGE removes empty rows and columns from the outside of a range, so formulas can point at whole columns without processing a million blanks.

Syntax

=TRIMRANGE(range, [trim_rows], [trim_cols])
Argument What it means
trim_rows 0 none, 1 leading, 2 trailing, 3 both (default).

Examples

Example 1

=UNIQUE(TRIMRANGE(A:A))

Unique values from a column that keeps growing.

DROP · FILTER

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong