Extra spaces are the quietest bug in a spreadsheet. A trailing space after "Acme " means it never matches "Acme". A double space in the middle of a name breaks a sort. And you cannot spot any of it by looking.
The good news is that whitespace is a solved problem. The question is how much effort the fix takes.
The Old Way (TRIM)
Google Sheets ships a TRIM function. It removes leading and trailing spaces and collapses runs of spaces down to one.
=TRIM(A2)That covers the common case. It does not touch other whitespace, though. Non-breaking spaces pasted from a website, tabs, and line breaks all survive TRIM untouched, so you end up nesting functions.
=TRIM(SUBSTITUTE(SUBSTITUTE(A2, CHAR(160), " "), CHAR(9), " "))Now the formula is guessing at every character that might be lurking. Miss one and the match still fails, and you are back to staring at two cells that look identical but are not.
The FITS Way (Just Ask)
With FITS, you describe the clean result. The AI strips every kind of stray whitespace, not just the plain space character.
=FITS("Remove all extra spaces and leave one space between words in: " & A2)No CHAR codes to remember. Non-breaking spaces, tabs, and stray line breaks all go, because the instruction is about the outcome you want, not the exact characters to hunt for.
When to Use Each
If your data only has plain spaces, TRIM is free and instant. Reach for =FITS() when text was pasted from the web, when hidden characters keep breaking matches, or when trimming is one step in a bigger cleanup. Whitespace rarely arrives alone, so pair it with removing special characters, standardizing date formats, or a full data normalize pass. Cleanup is one job on a long list. Read the full guide to automating Google Sheets tasks you used to need regex for.
Stop Hunting for Invisible Characters
FITS puts plain-English AI formulas inside Google Sheets. Describe the clean result you want. Get it back. Free tier included.