Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

NewJeffCT

(56,828 posts)
Wed Dec 11, 2013, 03:49 PM Dec 2013

Excel questions - deleting trailing spaces

I have a column of several hundred numbers. Some are two digit, some three, some four. However, they all seem to have trailing spaces after the numbers, so I can't add, subtract, divide, etc by the numbers and they all have trailing spaces.

I've tried (TRIM) and (CLEAN) functions, but neither worked. Normally, I would do (LEFT, 3) if every number was 3 digits, but I can't do that with numbers that are 2, 3 or 4 digits.

I also tried VALUE(C1) as well, and it didn't work.

A guide online mentioned using TRIM, SUBSTITUTE and CHAR, but that didn't work, either.

I've done similar a thousand times before over the years, but it's just not working this time. I think I'm using Excel 2007.

Thanks

23 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
Excel questions - deleting trailing spaces (Original Post) NewJeffCT Dec 2013 OP
Let me get this straight. Xyzse Dec 2013 #1
already tried both NewJeffCT Dec 2013 #3
Damn... I almost want a copy of that excel sheet just to see this marvel. Xyzse Dec 2013 #5
you can send me via PM NewJeffCT Dec 2013 #7
Done Xyzse Dec 2013 #8
thanks NewJeffCT Dec 2013 #11
De nada. Xyzse Dec 2013 #12
did the spreadsheet NewJeffCT Dec 2013 #13
Check junkmail? Xyzse Dec 2013 #14
ok NewJeffCT Dec 2013 #15
No prob. Xyzse Dec 2013 #16
Thanks NewJeffCT Dec 2013 #18
Use that... Xyzse Dec 2013 #20
This message was self-deleted by its author Xyzse Dec 2013 #10
The cells are stored as text, not numbers BlueStreak Dec 2013 #2
they're numbers NewJeffCT Dec 2013 #4
You might try this BlueStreak Dec 2013 #6
This message was self-deleted by its author lastlib Dec 2013 #9
highlight the column DrDan Dec 2013 #17
Message auto-removed Name removed Dec 2013 #19
You have Word too, right? jmowreader Dec 2013 #21
Why not format the column as number, not text? Ptah Dec 2013 #22
I did that NewJeffCT Dec 2013 #23

Xyzse

(8,217 posts)
1. Let me get this straight.
Wed Dec 11, 2013, 03:56 PM
Dec 2013

You have a column which are only numbers but have trailing spaces that you don't know what they are.
My suggestion, if you have data you want to preserve to its right, copy that column and put it at the right end.
Then, depending on which Excel you have, it is in the Data Tab. It is called "Text to Columns".

With that column highlighted, hit "Text to Columns" which is a three step process.
First step is to decide if you want it delimited or fixed width. Pick Delimited.
Second step, use whatever you think needs to be delimited, usually it is "space".
If the extra spaces are on the right of the numbers, you should be fine pretty quick. Otherwise, it would put all the numbers in different columns which you would have to manually place back to one.

Another possible solution is to copy that whole column, paste it on another column blank column, using the right click function and say "Paste Special" = Values Only. Then it will probably post it as the numbers without the space.

Good luck!

Xyzse

(8,217 posts)
5. Damn... I almost want a copy of that excel sheet just to see this marvel.
Wed Dec 11, 2013, 04:07 PM
Dec 2013

I can give you an email address, for me to play with it.

NewJeffCT

(56,828 posts)
7. you can send me via PM
Wed Dec 11, 2013, 04:09 PM
Dec 2013

I've converted text to numbers and vice versa a thousand times before. Not sure why it's not working this time.

Xyzse

(8,217 posts)
8. Done
Wed Dec 11, 2013, 04:13 PM
Dec 2013

Quite curious about this.

Oh! I edited it, and it is done. Check out if it is ok.

There is a hidden character at the end which I think might be a carriage return. It is now gone.

Xyzse

(8,217 posts)
12. De nada.
Wed Dec 11, 2013, 05:04 PM
Dec 2013

Oh, I used that "Delimited" function I was talking about, but I went to one of those cells, copied the extra space, so that I get whatever hidden character that is, and placed it in "Other".

It got kicked out of there. It was pretty awesome.

Xyzse

(8,217 posts)
14. Check junkmail?
Wed Dec 11, 2013, 05:06 PM
Dec 2013

My name is weird, so it could probably have gone there.

Sent it with another email too.

NewJeffCT

(56,828 posts)
18. Thanks
Wed Dec 11, 2013, 05:13 PM
Dec 2013

your sheet is working for me. However, how do I recreate it.

I tried text to columns>delimited>space but nothing happened?

Xyzse

(8,217 posts)
20. Use that...
Wed Dec 11, 2013, 06:39 PM
Dec 2013

However, go to one of the cells and go to the formula bar, copy the blank space there which is the hidden character.
Then put it in delimited "Other", and paste the copied hidden character there.

That should do it.

Response to NewJeffCT (Reply #7)

 

BlueStreak

(8,377 posts)
2. The cells are stored as text, not numbers
Wed Dec 11, 2013, 03:58 PM
Dec 2013

If you want to use those contents in a calculation, you can convert from text to numbers by enclosing the cell reference with the VALUE function.

http://spreadsheets.about.com/od/excelfunctions/qt/81206_value.htm

In LibreOffice, there is a plug-in that will convert all of those text cells to be real number (or date) cells so you can operate on them normally. I don't know if there isa plug-in like that for Excel.

Response to NewJeffCT (Original post)

DrDan

(20,411 posts)
17. highlight the column
Wed Dec 11, 2013, 05:10 PM
Dec 2013

then do an "edit - replace" putting a space in the first box and nothing in the second

the hit the "replace all"

this will get rid of all spaces in the column

Response to NewJeffCT (Original post)

jmowreader

(50,553 posts)
21. You have Word too, right?
Wed Dec 11, 2013, 09:07 PM
Dec 2013

And this is a single column of numbers? With no spaces in the numbers themselves?

Export to ASCII text. Open text in Word. Run find/change. In the find box put one space. Leave the "change to" box empty. Click "change all" until you get "no changes made." Save, open in Excel, go to town.

NewJeffCT

(56,828 posts)
23. I did that
Wed Dec 11, 2013, 09:37 PM
Dec 2013

I also multiplied the entire column by 1, which usually works, and that didn't, either.

my problem was solved above, though.

Latest Discussions»The DU Lounge»Excel questions - deletin...