Excel Remove Spaces Before Text

There are two ways to “excel remove spaces before text”: the quick way you copy and the durable way you understand. This page gives you both. The exact Excel answer is above with a tool to test it; below, we build the small mental model that makes the fix stick, so the next variation of the same problem solves itself.

Exact answer

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.

ƒxRemove Extra SpacesLive
Converted text
25

14 characters removed · 25 characters

Non-breaking spaces from web copy-paste are normalised too — TRIM alone leaves those behind.

=TRIM(SUBSTITUTE(A2,CHAR(160)," "))
=TRIM(A2)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

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. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel remove spaces before text”. 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. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. Here is the takeaway for “excel remove spaces before text”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.

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

On the way here you may have searched this as “remove space before text excel”, “how to remove a space before text in excel”, “how to remove space before text in excel” and “excel formula to take text until you hit a space” — it is all the same task, and this page is the single, complete answer to it.

Why do people search for this in so many different ways?

Because the same task has many names. “remove space before text excel”, “how to remove a space before text in excel”, “how to remove space before text in excel” all point at the one operation explained on this page, which is why they all lead here.