+ Reply to Thread
Results 1 to 3 of 3

Delete a character using an IF statement

  1. #1
    Registered User
    Join Date
    06-25-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Delete a character using an IF statement

    Hi all,

    Can anyone give me advice on how to clean up a dataset? The problem is that the dataset contains lots of entries that are not formatted correctly (e.g. I have entries like "United States " [note the space at the end] instead of "United States").

    Can anyone tell me how I can ask Excel to delete spaces at the end of strings (but only at the end and not in the middle)? I imagine this involves some sort of IF statement, but I really don't know where to begin.

    Thanks in advance for any assistance...

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Delete a character using an IF statement

    Try

    =trim(A1)

    adjust range to suit and copy where you need it.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete a character using an IF statement

    select the column
    then data /text to columns
    choose fixed width
    click next
    double click on any break lines to remove them
    in the same place click anywhere to right of your data to insert break line(making sure its as least as far over as to include your longest cell string.)
    click finish
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1