What the video covers
Apply TRIM to a column of text in a Google Sheets spreadsheet to produce a cleaned helper column and (optionally) replace the original data with the cleaned values.
Watch the video on YouTubeStep-by-step instructions
- Open your spreadsheet
Open the Google Sheets file that contains the raw text column you want to clean. - Insert a helper column
Create a new column next to the raw data column (for example, insert a column to the right). - Enter the TRIM formula
In the first row of the helper column (e.g., B2 if your raw data starts in A2), enter =TRIM(A2) and press Enter. This removes leading/trailing spaces and reduces repeated internal spaces to single spaces. - Fill the formula down
Copy the formula down the helper column for all rows (double-click the fill handle, drag it down, or use copy/paste) so every value is cleaned. - Use TRIM inside lookups if preferred
To avoid creating a helper column, wrap TRIM around lookup inputs directly (for example: =VLOOKUP(TRIM(A2), D:E, 2, FALSE)). - Optionally remove hidden characters
If you suspect hidden line breaks or non-printing characters, use =TRIM(CLEAN(A2)) to remove them before trimming whitespace. - Replace raw data with cleaned values (optional)
Copy the helper column, then paste over the original column using Paste special → Values only to replace raw text with the cleaned results.
Watch the video
Play tutorial
Why it matters
Extra spaces (leading, trailing, or multiple internal spaces) cause failed exact matches, incorrect sort orders, and bad exports. TRIM standardizes whitespace quickly and reliably.
Check your result
After applying TRIM, verify a few cells: there should be no leading or trailing spaces and consecutive internal spaces reduced to single spaces. Lookups and sorts should return expected results.
Troubleshooting
If hidden line breaks or non-printing characters remain, wrap TRIM around CLEAN (e.g., =TRIM(CLEAN(A2))). If formulas don't fill down, drag the fill handle or copy-paste the formula manually. If pasting values over originals still preserves spaces, ensure you pasted 'Values only'.