Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: How to TRIM() unruly characters?

  1. #1
    Guest

    Default

    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...

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try...

    =RIGHT(A1,LEN(A1)-3)+0

  3. #3
    Guest

    Default

    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.

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    83,584
    Post Thanks / Like
    Mentioned
    30 Post(s)
    Tagged
    6 Thread(s)

    Default

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •