logo
search
Formula Errors

How to Fix Excel SUBSTITUTE CHAR(160) #VALUE! Error

Elise WilliamsElise Williams Oct 9, 2026 869 views

Question details

Users encounter a #VALUE! error when attempting to use the SUBSTITUTE function alongside CHAR(160) to convert text containing non-breaking spaces into numbers.

How to Fix Excel SUBSTITUTE CHAR(160) #VALUE! Error
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Cleaning imported web data or system exports that contain non-breaking spaces (CHAR 160) so that the data can be calculated as numeric values.
Observed behavior
The formula returns a #VALUE! error because the application fails to recognize the cleaned string as a valid number, often due to lingering commas, standard spaces, trailing characters, or regional setting conflicts.
Before you start

Before applying complex formulas, verify your system's regional settings for decimal and thousands separators, as mismatching commas or periods can prevent text from converting to numbers.

Solution 1Recommended

Use the Double Unary or VALUE Function to Convert Text

This is the most direct method to replace non-breaking spaces and force the resulting clean text into a numerical value.

Often, data pasted from websites includes hidden non-breaking spaces (represented by CHAR(160) in Excel). Removing them is only the first step; you must also explicitly convert the result from text to a number.

1
Select a target cell

Click on an empty cell where you want the cleaned, numerical data to appear.

2
Enter the SUBSTITUTE formula with a double unary

Type the formula =--SUBSTITUTE(B2,CHAR(160),"") and press Enter. The double minus sign (--) forces the text output to become a number.

3
Alternative: Use the VALUE function

If you prefer not to use the double minus, you can achieve the exact same result by wrapping the formula in the VALUE function: =VALUE(SUBSTITUTE(B2,CHAR(160),"")).

Use the Double Unary or VALUE Function to Convert Text
Quick Check: By default, numbers align to the right of a cell, while text aligns to the left. If your result aligns right, the conversion was successful.
Clean Data Faster

Clean and Convert Data Seamlessly with WPS Spreadsheet

WPS Spreadsheet provides powerful data cleaning capabilities and full compatibility with advanced nested formulas like SUBSTITUTE and VALUE. Easily remove non-breaking spaces and troubleshoot #VALUE! errors in a free, lightweight, and user-friendly interface.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the data you need to clean.
  2. 2. Enter the formula: Select a blank cell and input =--SUBSTITUTE(A1, CHAR(160), "") to strip out the non-breaking spaces and convert the text to numbers.
  3. 3. Fill down the column: Click and drag the small square handle at the bottom right of the cell to apply the formula across your entire dataset instantly.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Lightweight and fast, handling large datasets with complex nested formulas effortlessly.Intuitive UI that makes writing, auditing, and troubleshooting text-cleaning formulas much easier.Free to use with comprehensive built-in support for data formatting functions.
microsoft office alternative - wps office

Frequently Asked Questions

What is CHAR(160) in spreadsheet formulas?

CHAR(160) represents a non-breaking space. It is very common in data copied from web pages or imported from external databases. Standard TRIM functions often fail to remove it, which is why SUBSTITUTE must be used.

Why does my formula return a #VALUE! error after using SUBSTITUTE?

The #VALUE! error occurs when you try to convert the cleaned text into a number (using -- or VALUE), but the application still doesn't recognize it as a valid number. This is usually caused by leftover commas, standard spaces, or mismatched regional settings for decimal separators.

What does the double minus (--) do in the formula?

The double minus, known as the double unary operator, coerces text representations of numbers (or boolean TRUE/FALSE values) into actual numeric values so that the spreadsheet can perform mathematical calculations on them.

How do I check my system's regional number settings?

In Windows, you can check this by going to Control Panel > Clock and Region > Region > Additional settings. Here you can see exactly which characters your computer expects for the decimal symbol and digit grouping (thousands) symbol.