Unwanted spaces in a text column

ktyldesley

New Member
Joined
May 11, 2011
Messages
4
Hi all,

I have a column containing text where many (but not all) of the entries have one or two keystroke spaces before the first word in the text entry. I want to remove those spaces without doing so manually.

For example, I may have a cell containing: "[space][space]auto" or "[space]auto".

What formula may I use to look for those spaces? The cell most often contains a string of several words so I can't simply delete all spaces in the column. Thanks!

Kevin
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
hi Kevin,

Welcome to MrExcel.

If you are happy using another column for a moment or two you could try using =TRIM() then do a Copy Paste Special Values.

Here's an example of =TRIM()

Excel Workbook
ABCD
1BeforeLengthAfterLength
2*Text *19Text 16
3Text 18Text 16
4*Text 1 *11Text 16
5TEXT 17TEXT 16
Sheet2


I have added =Len() (number of characters in a cell) so that you can see the difference.

Good luck.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

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