Lookup & Reference Excel 365 ◉ 26 views Dynamic Array

=TRIMRANGE()

The TRIMRANGE function excludes all empty rows and/or columns from the outer edges of a range or array.​​​​​​​​​​​​​​

Applies To: Excel for Microsoft 365
=TRIMRANGE(range,[trim_rows],[trim_cols])
Hover argument names in the table for details.
Output typeArray
Popularity35 / 100
VolatileNo
Dynamic ArrayYes
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =TRIMRANGE() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
Download TRIMRANGE.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
range Range Required The range (or array) to be trimmed
trim_rows Number Required Determines which rows should be trimmed0 - None1 - Trims leading blank rows2 - Trims trailing blank rows3 - Trims both leading and trailing blank rows (default)
trim_columns Number Required Determines which columns should be trimmed0 - None1 - Trims leading blank columns2 - Trims trailing blank columns3 - Trims both leading and trailing blank columns (default)

▣ Examples

Example 1 =TRIMRANGE(A:A)
Example 2 =UNIQUE(TRIMRANGE(A2:A1000))

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.