Solved

Getting rid of trailing space in MS Excel

Posted on 2014-12-16
3
132 Views
Last Modified: 2014-12-16
I cannot get rid of a trailing space in a cell.
The contents is always a string value although consisting of digits and this trailing space or something that I can't see.
The length of the string varies and sometimes the space is not there. so I can't use Left() function.
I have tried Trim() and Clean()
Can anyone help please.
I attach a small spreadsheet with the cell with the trailing space in and what I tried.
I Use W7 and Office 2010
Book1.xlsx
0
Comment
Question by:Fritz Paul
3 Comments
 
LVL 21

Accepted Solution

by:
Ejgil Hedegaard earned 300 total points
ID: 40503282
It is not a space, but ASCII code 160, so use this to remove it.
=SUBSTITUTE(B2,CHAR(160),"")
0
 
LVL 6

Assisted Solution

by:oferam
oferam earned 200 total points
ID: 40503283
Indeed it's a weird character you are trying to remove.

You can use the following function to remove it =SUBSTITUTE(B3," ",""), Basically it would replace it with nothing.

Attached is also a sample excel.
Book1.xlsx
0
 

Author Closing Comment

by:Fritz Paul
ID: 40503296
Thanks for your help.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question