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.
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
- Trim Early - Apply TRIM before other text operations
- Combine with Case - Often used with UPPER/LOWER
- Before Joins - Clean data before joining tables
- Validate After - Check results after trimming
Related Operations
- Text Case Conversions - UPPER, LOWER, PROPER
- Joining Columns - CONCAT with TRIM
- Replacing Text - SUBSTITUTE for other whitespace
Additional Formula References
- TRIM Formula →
- SUBSTITUTE Formula → (for other whitespace)
Additional examples will be added soon.