The Trim function in Excel only works when you pass arguments as texts. For example, the function will not work if you pass a cell location as an argument. Similarly, the Trim function only removes leading and trailing spaces. So if you’re trying to remove spaces between words, the function will seem not to work.

With that said, the Trim formula might not work even if you intend to use it correctly. The problems can range from rookie errors evenExcel expertsmay make, such as typing mistakes to corrupt Office program files.

TheTRIMfunction will not work if you’ve incorrectly entered your formula. This includes issues in syntax, argument, and function.

Excel-TRIM-function-syntax

To call any function in Excel, you must enter theequal to(=) sign. Ensure you’ve used the symbol before entering TRIM.

After you call the function, useparentheses ()to pass your arguments. The TRIM function uses text as its argument, so you must enclose your value indouble quotes(“ ”). If you enter your value without double quotes, you’ll encounter the #NAME? Error.

verify if you’ve entered the formula correctly. If you’re new to using Excel, take assistance from the formula wizard that appears as you enter a formula.

Formula-Wizard-Excel

you may only pass one argument in the TRIM function. Your argument must be a text and not a cell location. Excel will treat every argument, even numeric, as text in the TRIM function.

Show Formula Option Enabled

If the TRIM function is not showing results, you must have theShow Formulaoption enabled. you may verify if this feature is active from theFormulastab.

You could be dealing with corrupt program files that could create issues in the Excel program. When you have missing or corrupt program files, Excel might not have enough resources to follow your command.

Trim-function-format-Excel

you may perform an online repair and see if it solves your issue.

If you intend to utilize the TRIM to pass a cell location, you may use theSUBSTITUTEfunction as an alternative. The SUBSTITUTE function replaces a value with another set value.

you may also use thePower Queryto remove leading and trailing space from an entire column. Power Query can also act as an alternative to theSUBSTITUTEfunction.

Show-Formula-Option-Excel

you may utilize the SUBSTITUTE function in=SUBSTITUTE(text/cell, value to be replaced, new value)format.

In the Excel document above, we’ve used the SUBSTITUTE function to replace spaces between text in A2 with nothing. This removes all spaces in the text.

Apps-and-Features-1

Modify-Office-1

Repair-Office-1

SUBSTITUTE-function