TRIM Function Generator
TRIM removes leading and trailing spaces and collapses multiple internal spaces into one. Critical first step for any data imported from PDFs, web, or systems with inconsistent spacing.
Syntax
=TRIM(text)Try it — generate a TRIM formula
Examples
Clean imported names
=TRIM(A2)Removes leading/trailing spaces and double-spaces inside.
Trim + proper case
=PROPER(TRIM(A2))Clean spaces, then title-case the result.
Trim before VLOOKUP
=VLOOKUP(TRIM(A2), Table, 2, FALSE)Prevents lookup failures from trailing spaces.
Tips
- ✓TRIM preserves exactly one space between words.
- ✓TRIM does not remove non-breaking space (CHAR(160)). Use SUBSTITUTE to strip those.
- ✓Always TRIM user-pasted data before lookups.
Related Formulas
SUBSTITUTE
SUBSTITUTE replaces occurrences of a specific text inside a string. Lets you tar...
CLEAN
CLEAN removes non-printable characters (like line breaks, tabs) from text. Pair ...
VLOOKUP
VLOOKUP searches for a value in the first column of a table and returns a value ...
Need a different formula?
Describe any formula in plain English and FormulaPad will generate it.
Try FormulaPad Free