Skip to main content

Removing Extra Spaces

Clean up text by removing leading, trailing, and extra spaces using the TRIM formula.

Relevant Formula

TRIM

Removes extra spaces from text, leaving only single spaces between words.

View TRIM Formula Reference →

Basic Usage

=TRIM([text_column])
Input: " Hello World "
Result: "Hello World"

Common Use Cases

Data Cleaning

// Clean user input
=TRIM([customer_name])

// Standardize before comparison
=IF(TRIM(UPPER([input])) = "YES", true, false)

Before Concatenation

// Clean before combining
=CONCAT(TRIM([first_name]), " ", TRIM([last_name]))

Preparation for Matching

// Clean for joins or lookups
=TRIM(LOWER([email]))

Advanced Techniques

Nested with Other Functions

// Clean and convert case
=UPPER(TRIM([company_name]))

// Clean and extract
=LEFT(TRIM([text]), 10)

Best Practices

  1. Trim Early - Apply TRIM before other text operations
  2. Combine with Case - Often used with UPPER/LOWER
  3. Before Joins - Clean data before joining tables
  4. Validate After - Check results after trimming

Additional Formula References


Additional examples will be added soon.