How to TRIM() unruly characters?

G

Guest

Guest
I am importing a table from a Web page by just cutting and pasting. (Yes it is legal) Everything appears to work except for the number strings that have a decimal point. Upon closer inspection I discovered that 2 line feed and a space precede each number. In hex the string is A0, A0, 20, 32, 37, 36, 2E, 30, 30 I have tried clean() and trim() without success? Any suggestions? TIA

Rocky...
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Thank you! As usual the problem shows more details as solutions are applied. The column is always contains ten characters. The numbers are right justified and padded with A0's. So the solution works for the case given, but fails with more or less digits. The space appears to always be right before the first digit. The LEN(A1) always returns 10 regardless of the number of digits.
 
Upvote 0
On 2002-02-21 19:48, Anonymous wrote:
Thank you! As usual the problem shows more details as solutions are applied. The column is always contains ten characters. The numbers are right justified and padded with A0's. So the solution works for the case given, but fails with more or less digits. The space appears to always be right before the first digit. The LEN(A1) always returns 10 regardless of the number of digits.

I wonder whether what follows would work for you:

In B1 enter:

=SUBSTITUTE(A1,RIGHT(A1,SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{".",0,1,2,3,4,5,6,7,8,9},""))))),"")

In C1 enter:

=SUBSTITUTE(A1,B1,"")+0

where A1 houses an entry you need to clean.

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,563
Messages
6,114,329
Members
448,564
Latest member
ED38

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