Solved

How can I remove all spaces following the last character in a cell

Posted on 2013-01-26
4
272 Views
Last Modified: 2013-01-29
How can I remove all spaces following the last character in a cell?  In other words...

"# 264,265 BTMPI, # 266  CLINK                  53 after            "

would end up like...

"# 264,265 BTMPI, # 266  CLINK                  53 after"

(without the quote marks)

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Martin Liss
ID: 38822481
=TRIM(your cell address)
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38822488
=IF(LEN(TRIM(A1)),REPLACE(LEFT(A1,LOOKUP(2^15,FIND(RIGHT(TRIM(A1)),A1,ROW(INDIRECT("1:"&LEN(A1)))))),1,FIND(LEFT(TRIM(A1)),A1)-1,""),"")

Courtesy barryhoudini
0
 

Author Comment

by:SteveL13
ID: 38824374
=TRIM(your cell address)   didn't do anything.  I copied the formula into the space at the top of the spreadsheet as =TRIM(C2) which is the real field I want trimmed and nothing happened other than =TRIM(C2) appeared in cell D2 ???????????


The same thing happens with...   =IF(LEN(TRIM(A1)),REPLACE(LEFT(A1,LOOKUP(2^15,FIND(RIGHT(TRIM(A1)),A1,ROW(INDIRECT("1:"&LEN(A1)))))),1,FIND(LEFT(TRIM(A1)),A1)-1,""),"")

The formula just appears in D2.

I'm sure I'm doing something wrong.
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38824464
Check this file
Clean-external-spaces.xlsx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

636 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