Formualizer Docs
ReferenceFunctionsText Functions

TRIM

TRIM: Removes leading/trailing whitespace and collapses internal runs to single spaces.

Summary

Removes leading/trailing whitespace and collapses internal runs to single spaces.

Remarks

  • Leading and trailing whitespace is removed.
  • Consecutive whitespace inside the text is collapsed to one ASCII space.
  • Non-text inputs are coerced to text before trimming.
  • Errors are propagated unchanged.

Examples

Normalize spacing
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
alpha beta
Already clean text
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
report

FAQ

What whitespace does TRIM normalize?

It trims edges and collapses internal whitespace runs to single spaces.

Runtime metadata

Category

Text

Signature

TRIM(arg1: Any)

Arity

min 1, max 1

Arguments

arg1

Any · Scalar

Caps

PURE

Source

On this page