+ Reply to Thread
Results 1 to 7 of 7

Extracting out of a emai address string

  1. #1
    Registered User
    Join Date
    08-05-2005
    Posts
    59

    Extracting out of a emai address string

    Hi,

    I'm trying to extract the domain name/company name of an email address string. So anything after the "@" and before the "."

    I've got 400 emails and i've got to catergorise them by company.

    Your help is much appreciated.

  2. #2
    Guest

    Re: Extracting out of a emai address string

    Hi
    Try this:
    =MID(A2,SEARCH("@",A2)+1,SEARCH(".",A2)-SEARCH("@",A2)-1)

    Andy.

    "harpscardiff" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hi,
    >
    > I'm trying to extract the domain name/company name of an email address
    > string. So anything after the "@" and before the "."
    >
    > I've got 400 emails and i've got to catergorise them by company.
    >
    > Your help is much appreciated.
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile:
    > http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=550354
    >




  3. #3
    Registered User
    Join Date
    08-05-2005
    Posts
    59
    Thanks for the reply.

    I've tried it, works for some and not for others. theres no obvious pattern?

  4. #4
    Guest

    Re: Extracting out of a emai address string

    Hi
    I suppose this could happen if the name before the @ contained a period?

    Andy.

    "harpscardiff" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks for the reply.
    >
    > I've tried it, works for some and not for others. theres no obvious
    > pattern?
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile:
    > http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=550354
    >




  5. #5
    Guest

    Re: Extracting out of a emai address string

    Try this:
    =MID(A2,SEARCH("@",A2)+1,SEARCH(".",A2,SEARCH("@",A2))-SEARCH("@",A2)-1)

    Andy.

    "harpscardiff" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks for the reply.
    >
    > I've tried it, works for some and not for others. theres no obvious
    > pattern?
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile:
    > http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=550354
    >




  6. #6
    Registered User
    Join Date
    08-05-2005
    Posts
    59
    spot on Andy, worked like a charm.

    Not compulsory, any chance you can explain whats going on in the formula?

    I understand the Mid, but the rest, i didn't know it was possible.

    Cheers.

  7. #7
    Guest

    Re: Extracting out of a emai address string

    Hi

    =MID(A2,SEARCH("@",A2)+1,SEARCH(".",A2,SEARCH("@",A2))-SEARCH("@",A2)-1)

    The MID function uses 'cell', followed by 'start address', followed by
    'number of characters to return'.
    The 'cell' is A2.
    The 'start address' is 'find the position of @ and add 1'.
    The 'number of characters' is 'find the position of . after the @'

    Hope this helps! It may be useful for you to use a very simple example and
    then select each part of the formula in the formula bar and press F9 to view
    its results.

    Andy.

    "harpscardiff" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > spot on Andy, worked like a charm.
    >
    > Not compulsory, any chance you can explain whats going on in the
    > formula?
    >
    > I understand the Mid, but the rest, i didn't know it was possible.
    >
    > Cheers.
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile:
    > http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=550354
    >




+ 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