How to remove extra spaces in a cell

Chris1973

Board Regular
Joined
Apr 17, 2020
Messages
115
Office Version
  1. 2016
Platform
  1. Windows
Hi there

I have about 7800 codes

Some of them have extra space between them, how do i remove the extra spaces

code should be like

00893 200 200

instead is it now like

00893 200 400

Is there a way to remove the extra space obly to 1 space between each. I know you can use the rim function but i dont come right
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Do you mean that you have two spaces in between some values and you want to trim it to one?
If so, simply do a Find Replace, and replace two spaces with one, and choose "Replace All".
 
Upvote 0
I know you can use the rim function but i dont come right
That suggests you might have non-breaking spaces of some sort.
Select the cells, Ctrl H, in "Find what" enter Alt 0160 (using the number keypad) & leave the replace box empty.
Then make sure that "Match entire cell" is unchecked & click replace all.
 
Upvote 0
This is the problem, some have 2 spaces, some have 3 and some have 4.

Just want there to be one space between 00893 and 200 and 200
 
Upvote 0
@Fluff
When i do this do i get the message there is nothing to replace, however it is there
 
Upvote 0
Did you try my solution?
Did that do anything?

If they are normal spaces, and 4 is maximum number of spaces you have between items, just do what I proposed three times, and it should take care of it.
 
Upvote 0
Thanks, guys, got it right using the trim function.

Created a helper column, entered the code =Trim(a1)

Copied and paste and all extra spaces gone
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,945
Members
449,275
Latest member
jacob_mcbride

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top