In Excel: use =TRIM(A2) to remove leading, trailing and repeated normal spaces, and combine it with SUBSTITUTE for non-breaking spaces from web data.
14 characters removed · 25 characters
Non-breaking spaces from web copy-paste are normalised too — TRIM alone leaves those behind.
What this does
TRIM cleans normal spaces around and between words. Data copied from websites can contain non-breaking spaces, which TRIM alone may not remove. In that case, SUBSTITUTE(A2,CHAR(160)," ") replaces non-breaking spaces before TRIM cleans the result. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel remove spaces from string”. Start on a copy or a tiny sample, keep the affected spaces visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a data step that keeps your analysis trustworthy, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
A2 contains " ACME West ". =TRIM(A2) returns "ACME West". If imported text still refuses to match, use =TRIM(SUBSTITUTE(A2,CHAR(160)," ")). Space cleanup fixes failed lookups, duplicate detection and joins where values look identical but do not match. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “excel remove spaces from string” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
Common mistakes
- Using Find/Replace space with nothing and removing intentional spaces inside names.
- Forgetting non-breaking spaces.
- Replacing formulas before checking results.
- Cleaning only one lookup column when both sides need
TRIM.
Frequently asked questions
What does TRIM remove?
Leading, trailing and repeated normal spaces.
Why are spaces still there?
They may be non-breaking spaces, character 160.
Can I remove all spaces?
Use SUBSTITUTE(A2," ",""), but only when internal spaces are truly unwanted.
Other ways people ask this
This is also commonly searched as “how to remove spaces from a string in excel”, “remove spaces in excel string” and “remove space from string excel”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “how to remove spaces from a string in excel”, “remove spaces in excel string”, “remove space from string excel” all point at the one operation explained on this page, which is why they all lead here.