How to Fix Excel SUBSTITUTE CHAR(160) #VALUE! Error
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.

- 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 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.
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.
Click on an empty cell where you want the cleaned, numerical data to appear.
Type the formula =--SUBSTITUTE(B2,CHAR(160),"") and press Enter. The double minus sign (--) forces the text output to become a number.
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),"")).

Remove All Commas, Spaces, and Trailing Characters
Use this nested formula approach when your data contains a mix of standard spaces, commas, and trailing characters that a simple CHAR(160) replacement cannot fix.
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. Open your dataset: Launch WPS Spreadsheet and open the document containing the data you need to clean.
- 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. 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.

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.




