Forum Discussion
Help! Removing a Space in Excel
Hi group. Need some help here. I have 12000 records that need to have a space removed.
| Precision T3600 (Dell) |
7 Replies
- peiyezhuBronze Contributor
- Harun24HRBronze Contributor
I copy your data and paste to my Excel. I found that you have hidden character rather than space which represent Char(160). So, use SUBSTITUTE() function to remove those chars like-
=SUBSTITUTE(A2,CHAR(160),"")If, in your real file you have only spaces (more than one) then use the following formula-
=TEXTJOIN(" ",1,TEXTSPLIT(A3," ")) If this is in a single column, for example in D1:D12000:
In an empty column, enter the following formula in the cell in row 1:
=TRIM(D1:D12000)
The formula result will spill down to row 12000.
Select the result, copy it, then paste as values over D1:D12000.
You can now clear the column with the formulas.
If the data are in multiple columns, you might use a macro (in the desktop version of Excel).
Let me know if you need that.
- Harun24HRBronze Contributor
TRIM() will remove only leading & trailing spaces but OP wants to remove from middle of sentence. So, TRIM() shouldn't work here.
- Riny_van_EekelenPlatinum Contributor
"TRIM() will remove only leading & trailing spaces but OP wants to remove from middle of sentence. So, TRIM() shouldn't work here."
Not true!