Remove Spaces from Long Numbers in Excel Without Losing Digits
Question details
Remove embedded spaces from a long number while preserving every digit.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user needs to clean a value such as 8350 8380 8384 8385 without converting it to a numeric value.
- Observed behavior
- The desired result is a continuous string of digits displayed without rounding or scientific notation.
Make sure the original value is stored as text before removing spaces. Excel retains only 15 significant digits in numeric values, so digits already rounded during entry or import cannot be recovered from the cell.
Use SUBSTITUTE to Remove Spaces and Keep the Result as Text
Use this formula when the original long value is stored as text and contains ordinary spaces.
Select cell D5 and check the formula bar to confirm that the original value contains all its digits. If it was rounded during import, reimport it from the original source as text.
Select an empty cell, such as E5, enter =SUBSTITUTE(D5," ","") and press Enter. The result is returned as text.
Select E5 and drag its fill handle down to remove spaces from additional values in column D.
If you no longer need the formulas, copy the results and use Home > Paste > Values to paste them as text values.

Import Long Values as Text Before Removing Spaces
Use this approach when the source data has not yet been imported or when an earlier import rounded its digits.
Remove Spaces from Long Numbers in WPS Spreadsheets
Use WPS Spreadsheets to store long values as text and remove embedded spaces with the SUBSTITUTE function.
- 1. Set the source cells to text: In WPS Spreadsheets, select the destination cells, press Ctrl+1, and choose Text in the cell format options before entering the long values.
- 2. Enter the original value: Type or paste the spaced value into cell D5 and check the formula bar to confirm that every digit is present.
- 3. Remove the spaces: Select E5, enter =SUBSTITUTE(D5," ","") and press Enter. Keep the result as text rather than converting it to a number.
- 4. Save the cleaned values: Drag the fill handle down for additional rows, then use Copy and Paste Special > Values if you need fixed results instead of formulas.

Frequently Asked Questions
Why did Excel change the last digit of my long number?
Excel stores numeric values with only 15 significant digits. Re-enter or reimport the original value as text; formatting an already rounded number as text will not restore the lost digits.
How do I keep a long number from appearing in scientific notation?
Format the destination cell as Text before entering the value, or set the column to Text during import. The SUBSTITUTE formula also returns its result as text.
What if SUBSTITUTE does not remove the spaces?
The characters may be nonbreaking spaces rather than ordinary spaces. Try =SUBSTITUTE(D5,CHAR(160),"") or nest it with the ordinary-space formula to remove both types.
Can I replace the formulas with the cleaned values?
Yes. Copy the formula results, then select Home > Paste > Values. Keep the pasted values as text to preserve all digits.




