Remove space from end of text cell

cidgreen

New Member
Joined
Aug 26, 2002
Messages
22
Hello everyone,

Does anyone know if there is a quick way to remove a space from the end of a text cell?

I have a list of names in a column, such as Real Madrid, Osasuna, Tenerife, Celta Vigo, but some of them have a space after the name which is fouling up my attempts to sort them. Because some of them are two words or more I cannot replace the space with nothing.

There are 18 and a half thousand rows in this file, I'm not just being lazy!

Is there a clever way to remove an unwanted space at the end of a text cell that anyone knows of?

Thanks,
Chris.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
On 2002-09-23 06:36, cidgreen wrote:
Hello everyone,

Does anyone know if there is a quick way to remove a space from the end of a text cell?

I have a list of names in a column, such as Real Madrid, Osasuna, Tenerife, Celta Vigo, but some of them have a space after the name which is fouling up my attempts to sort them. Because some of them are two words or more I cannot replace the space with nothing.

There are 18 and a half thousand rows in this file, I'm not just being lazy!

Is there a clever way to remove an unwanted space at the end of a text cell that anyone knows of?

Thanks,
Chris.

I think you're being really lazy :biggrin:

but I am to.

In a blank column put:

=TRIM(A1)

where A1 is the start of your data, drag this down the column.
Copy>Paste Special>Values into the orignal column.

TRIM will take out any unwanted spaces, inc. before and after a text string.

Hope this helps,
 
Upvote 0
Ahhhahaha I knew there would be a way round it - you're a legend!

Thanks very much,
The King of Laziness no wait I mean Chris.
 
Upvote 0
I think I'm lazier than the both of you, I won't resort to the high level thinking required with formulas, I'd just use find & replace (find..2 spaces of the spacebar, replace nothing)
 
Upvote 0
On 2002-09-23 07:54, AP wrote:
I think I'm lazier than the both of you, I won't resort to the high level thinking required with formulas, I'd just use find & replace (find..2 spaces of the spacebar, replace nothing)

This won't solve the problem though, as has been stated in the OP's question:

Is there a clever way to remove an unwanted space at the end of a text cell that anyone knows of?
 
Upvote 0
Actually, as long as you set it to look for at least 2 blank spaces and not one, it should work.
 
Upvote 0
But TRIM does the job perfectly, so I'm going with that from now on. With a massive list like I have it would take ages doing it the other way (trust me, I got halfway through it before TRIM saved me...)

Cheers,
Chris.
 
Upvote 0
the only problem with:

=SUBSTITUTE(A1," ","")

is that it will not only remove the space at the end of the text string, but every space within the text string.

kevin
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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