logo
search
Formula Errors

Fix Excel TRIM Formula Displaying as Text Not Working

Guest WriterGuest Writer Sep 30, 2026 869 views

Question details

The Excel TRIM function displays the formula text itself instead of executing and removing extra spaces from the targeted cells.

Fix Excel TRIM Formula Displaying as Text Not Working
Product
Microsoft Excel
Device & OS
not provided
Scenario
Trying to clean up text data by removing leading and trailing spaces using the TRIM function.
Observed behavior
The cell displays the actual typed formula as ordinary text rather than evaluating it to show the cleaned result.
Before you start

Ensure that you haven't accidentally typed a single quote (') before the equals sign in your formula, or enabled the 'Show Formulas' view, as both will force Excel to display the formula as text regardless of cell formatting.

Solution 1Recommended

Change Cell Format to General and Re-enter Formula

This is the most common and effective fix. When cells are formatted as 'Text', Excel ignores formula calculations. Switching the format to 'General' allows Excel to calculate the formula properly.

If a cell's formatting was set to Text before you typed the formula, Excel will interpret your keystrokes literally. You must change the format back to General and force Excel to recalculate the cell.

1
Select the affected cells

Highlight the specific cells where your TRIM formula is displaying as text instead of functioning correctly.

2
Change format to General

Go to the 'Home' tab on the top ribbon, locate the 'Number' group, click the format dropdown menu (which likely says 'Text'), and select 'General'.

3
Re-enter the formula

Double-click the cell with the formula (or click directly into the formula bar at the top) and press 'Enter'. This forces Excel to re-evaluate the cell as a formula.

Change Cell Format to General and Re-enter Formula
Quick Recalculation for Multiple Cells: If you have an entire column of formulas to update, change the format to General first. Then, keep the column selected, go to the 'Data' tab, click 'Text to Columns', and simply click 'Finish'. This instantly recalculates all formulas in the column.
Data Cleanup with WPS Spreadsheet

Easily Clean Up Text Data with WPS Spreadsheet

WPS Spreadsheet provides a seamless and highly compatible environment for your data cleaning tasks. It perfectly handles standard Excel formulas like TRIM, and its intuitive interface makes cell formatting and formula evaluation straightforward.

  1. 1. Open your document: Launch WPS Spreadsheet and open the file containing the text data you need to clean.
  2. 2. Prepare an adjacent column: Select the empty cells next to your data and ensure their format is set to 'General' in the Home tab.
  3. 3. Apply the TRIM formula: Type =TRIM(cell_reference) in the first empty cell and press Enter to remove extra spaces.
  4. 4. Drag to fill: Click and drag the small square at the bottom-right corner of the cell to apply the TRIM formula to the rest of your list.
Fully compatible with Microsoft Excel (.xlsx) files and standard formulas.Intuitive interface for easy cell formatting and rapid data cleanup.Lightweight and fast, even when handling large datasets with complex formulas.Free to use with comprehensive spreadsheet capabilities for everyday office work.
QA img-9

Frequently Asked Questions

Why does Excel show my formula instead of the calculated answer?

This usually happens for two reasons: either the cell is formatted as 'Text' before you typed the formula, or the 'Show Formulas' feature is accidentally turned on. You can toggle 'Show Formulas' off by pressing 'Ctrl + `' (grave accent) on your keyboard or clicking it under the Formulas tab.

Can the TRIM function remove non-breaking spaces in Excel?

No, the standard TRIM function only removes regular space characters. To remove non-breaking spaces (often found when copying data from web pages), you need to combine the TRIM and SUBSTITUTE functions. For example, use =TRIM(SUBSTITUTE(A1, CHAR(160), " ")).

How do I quickly apply the General format to an entire column?

Click the column letter at the very top of the worksheet to select the entire column. Next, go to the Home tab on the ribbon, click the Number Format dropdown box, and select 'General'. Remember that you will still need to re-enter or refresh any existing formulas for the format change to take effect.