Solved

Getting rid of trailing space in MS Excel

Posted on 2014-12-16
3
123 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now