Remove Spaces from Numbers and Replace Negatives with Zero in Excel
Question details
Remove spaces from numbers stored as text and convert negative values to zero while preserving positive values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains values such as "1 016" and negative numbers that need to be cleaned for use in formulas.
- Observed behavior
- Numbers containing spaces may be stored as text and may not work correctly in formulas; negative values need to become zero.
Identify the column containing the values and choose an empty neighboring column for the results. Check that decimal separators in the data match your spreadsheet's regional settings.
Use a Helper Formula to Clean Numbers and Replace Negatives
Use one formula to remove ordinary and nonbreaking spaces, convert the result to a number, and replace negative values with zero.
If the first source value is in A1, select B1 and enter =MAX(0,VALUE(SUBSTITUTE(SUBSTITUTE(A1,CHAR(160),"")," ",""))).
Drag the fill handle at the lower-right corner of B1 down alongside the values in column A.
Select and copy the results in column B. Select A1, then choose Home > Paste > Paste Special > Values to replace the original data with the cleaned numbers.

Clean Spaced Numbers and Negative Values in WPS Spreadsheet
Use a helper formula in WPS Spreadsheet to remove spaces, convert text to numbers, and replace negative values with zero.
- 1. Open the workbook: Open your Excel workbook in WPS Spreadsheet and locate the column containing the values.
- 2. Enter the formula: If the first value is in A1, select B1 and enter =MAX(0,VALUE(SUBSTITUTE(SUBSTITUTE(A1,CHAR(160),"")," ",""))).
- 3. Fill the remaining rows: Drag the fill handle from B1 down to apply the formula to the other values.
- 4. Paste values if needed: Copy the results, select the original cells, and use Paste Special > Values to replace the source data.

Frequently Asked Questions
Why does a number such as "1 016" not work in my Excel formula?
Excel may treat the spaced value as text. Use =VALUE(SUBSTITUTE(A1," ","")) in a helper cell to remove ordinary spaces and convert the result to a number.
How do I remove nonbreaking spaces from numbers?
Use SUBSTITUTE(A1,CHAR(160),"") to remove nonbreaking spaces. Nest it inside another SUBSTITUTE function if the data may also contain ordinary spaces.
Can I replace negative numbers without removing spaces?
For cells that already contain numeric values, enter =IF(A1<0,0,A1) in a neighboring cell and fill the formula down.
How do I keep the cleaned numbers without keeping the formulas?
Copy the helper-column results, select the destination cells, and choose Home > Paste > Paste Special > Values in Excel.




