+ Reply to Thread
Results 1 to 5 of 5

Removing prefix on email address to leave company name in field

  1. #1
    Registered User
    Join Date
    12-07-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Removing prefix on email address to leave company name in field

    Hi,

    I have a question regarding deletion and replacement in a new field.

    ie. A1 reads dave.jones@microsoft.com
    I want A2 to read microsoft

    What is the code to delete "dave.jones@" and ".com" to be revealed in a new field.

    Cheers.
    Last edited by ecommerabmercer; 12-07-2009 at 12:47 PM.

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

    Re: Removing prefix on email address to leave company name in field

    Try:

    =MID(A1,FIND("@",A1)+1,FIND(".com",A1)-FIND("@",A1)-1)
    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.

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

    Re: Removing prefix on email address to leave company name in field

    or if it is not always .com at the end...

    =MID(A1,FIND("@",A1)+1,LEN(A1)-FIND("@",A1)-4)

  4. #4
    Registered User
    Join Date
    12-07-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Removing prefix on email address to leave company name in field

    Many Thanks

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

    Re: Removing prefix on email address to leave company name in field

    it could be something like martin.wilson@fred.co.uk
    so try
    =LEFT(MID(A1,FIND("@",A1)+1,20),FIND(".",MID(A1,FIND("@",A1)+1,20))-1)
    "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