+ Reply to Thread
Results 1 to 25 of 25

Excel 2007 : Removing characters in a cell

  1. #1
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Question Removing characters in a cell

    I have a list of contacts that has been corrupted during a sync between Outlook and Google Contacts There are 900 + email address that are affected. The email fields should read '[email protected]' but now all read '[email protected] SMTP [email protected]'.

    I am new to anything but the most basic add/subtract formulas and have spent a few hours trying to search for a solution to this with no luck.

    I need to remove everything after the end of (right of) the email addresses on the left including the space before 'SMTP'.

    Is there a formula for trimming from (and including) the first space onward to the right? I tried using the RIGHT and LEFT formula functions and putting in a 'space' for the text and 40 for the characters but it just deletes all the text,
    Last edited by whofan; 09-23-2011 at 01:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Help for non VBA user on removing characters in a cell

    How about ...

    =LEFT(A1, FIND("SMTP", A1) -2)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    Slight variation
    =TRIM(MID(A1,1,FIND(" ",A1)))
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Removing characters in a cell

    Hi, Scotty,

    That's better, if it works. My thought, from the OP's comment, was that what appears as a space might instead be a non-breaking space.

  5. #5
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Thank you for your suggestion. I’m sorry to ask what may be a dumb question but where should I be entering that formula?

    I changed your formula to match my range of cell =LEFT(N1:N990, FIND("SMTP", N1:N990) -2)
    I also tried =LEFT(N1, FIND("SMTP", N990) -2)

    When I entered your formula in an adjacent cell and covered only the one cell it did work for that one cell =LEFT(N1, FIND("SMTP", N1 -2) Trying to use the ‘drag the corner’ method of copying that function and the copy/paste special/formula only copied the result of the original cell.

    How can I get it to cover an entire range and where should I be entering it? I am assuming a blank cell off to the side or top…

  6. #6
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Note than not every cell in the column contains an email address or any data...

  7. #7
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    When I apply this trim formula to one cell I get '[email protected] SMTP"

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Removing characters in a cell

    Hi,

    Could you upload a sample wokrbook so we can test the solutions? You can dummy the actual emails.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  9. #9
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Won't let me attach a .csv. I am wondering if the .csv format could be part of the issue?

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Removing characters in a cell

    Zip it and post the Zip.

  11. #11
    Forum Contributor tkowal's Avatar
    Join Date
    11-20-2010
    Location
    Miami, Fl
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Removing characters in a cell

    Assuming your Email Address are in Column A then why not use

    =SUBSTITUTE(A1," SMPT","")

    Then copy down

  12. #12
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    In adding this formula, I made the assumption that all email addresses had imported with the same additional Space and Text If your layoit is different then use Shg'sformula and adjust accordingly to refer to the cells where you hold the email addresses

    =TRIM(MID(A1,1,FIND(" ",A1))) This formula will be entered in B1 if your email address with the additional space and SMTP are in A1. You then drag it down the B column adjacent to the rest of your list. Where you have the formula against a cell with no corresponding email address, you will get a #VALUE Error, Using Trim on it's own won't remove anything, it's used within the Formula to remove any extra spaces before or after the selection. Yo get rid of the #VALUE error we can add an error handler to the Formula using =IFERROR(TRIM(MID(A1,1,FIND(" ",A1))),"") which will leave you with a blank cell when the cell in column A is empty

    If you're still not sure, upload an excel spreadsheet with a copy of your spreadsheet

  13. #13
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Good advice, done!



    Quote Originally Posted by Marcol View Post
    Zip it and post the Zip.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    OK, I tried this one. My email address column is N.
    I entered =IFERROR(TRIM(MID(N174,1,FIND(" ",N174))),"") in the M column on line 174. That changed the N174 data correctly. When I drag/copy to the M cells below it repeats the email address that was listed in N174 in every cell.

  15. #15
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Thanks for the suggestion but this one had no effect, The email address remained the same with the "[email protected] SMTP [email protected]" format


    Quote Originally Posted by tkowal View Post
    Assuming your Email Address are in Column A then why not use

    =SUBSTITUTE(A1," SMPT","")

    Then copy down

  16. #16
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Saving as an .xls and applying the function formulas was no different so it is not a .csv issue

    Quote Originally Posted by whofan View Post
    Won't let me attach a .csv. I am wondering if the .csv format could be part of the issue?

  17. #17
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    ok, from the top line in the sample, from this [email protected] SMTP [email protected]

    to be shortened to this? [email protected]

  18. #18
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Yes. That is exactly it. Keeping in mind that, like my sample, there are two columns of email addresses and, some cells have no data. If that is a problem I can alsways sort the cells and apply the fix to just the cells with data.


    Quote Originally Posted by scottylad2 View Post
    ok, from the top line in the sample, from this [email protected] SMTP [email protected]

    to be shortened to this? [email protected]

  19. #19
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    Try these, works ok in Excel 2010

  20. #20
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    The CSV didn' t upload, saved as xlsx and you can save it on your side as csv if you require
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    First let me say I very much appreciate your help!

    I am still doing something wrong. When I use the fill handle to drag and copy the formula down it only repeats the same email address result as the original cell I am dragging. What do I need to do differently to copy the formula but have it update to the new adjacent cell numbers?

    Quote Originally Posted by scottylad2 View Post
    The CSV didn' t upload, saved as xlsx and you can save it on your side as csv if you require

  22. #22
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Removing characters in a cell

    Go to Formulas tab, then Calculation Options... make sure Automatic is selected.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  23. #23
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Removing characters in a cell

    Thank you!! So simple if you just know where to look....

    SOLVED!!

    Quote Originally Posted by NBVC View Post
    Go to Formulas tab, then Calculation Options... make sure Automatic is selected.

  24. #24
    Registered User
    Join Date
    09-22-2011
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Thumbs up Re: Removing characters in a cell

    Thank you again scottylad2 for providing the magic formulas that worked!!

    Quote Originally Posted by scottylad2 View Post
    The CSV didn' t upload, saved as xlsx and you can save it on your side as csv if you require

  25. #25
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Removing characters in a cell

    Glad to help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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