+ Reply to Thread
Results 1 to 8 of 8

Identifying the pattern

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Identifying the pattern

    Hi All,

    I have First Name, Last Name and Email. I have to identify the type of email pattern which I had mentioned in Column D. Please find the attachment.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Identifying the pattern

    Give this a shot:
    =IFERROR(IF(ISERROR(FIND(LOWER(B2),C2,1)),$A$1&MID(C2,LEN(A2)+1,FIND("@",C2,1)-LEN(A2)-1),$A$1&MID(C2,LEN(A2)+1,FIND(LOWER(B2),C2,1)-LEN(A2)-1)&$B$1),"FirstInitialLastName")

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Identifying the pattern

    Something like below. You could use RegEx, but since RegEx is system dependent... I used string manipulation.

    Please Login or Register  to view this content.
    Then in D2:
    =EmailPattern(A2,B2,C2)

    Copy down.
    Last edited by CK76; 11-08-2019 at 02:21 PM. Reason: Changed code a bit to reduce redundancy
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Re: Identifying the pattern

    In some cases only lastname will be in email column.

    Example

    Greg Piggott [email protected]

    The result should come like LastName

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Identifying the pattern

    Try this then...
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    Re: Identifying the pattern

    Code is not working

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Identifying the pattern

    Code is not working
    Can't help you without you helping me. How is it not working?

    Small amendment to code as I noticed one thing. Check for x = lName rather than checking for length.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Identifying the pattern

    Here is another macro that you can consider...
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 11-08-2019 at 07:28 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 08-27-2019, 08:37 AM
  2. Continuing a pattern on autofil without pattern re-starting
    By jakeyoung111 in forum Excel General
    Replies: 4
    Last Post: 06-22-2016, 11:11 AM
  3. [SOLVED] Lookup and return rows based on pattern start and pattern end
    By JDI in forum Excel General
    Replies: 18
    Last Post: 11-16-2014, 11:44 PM
  4. Copy down hypertext cell range pattern & cell reference formula pattern
    By Underexcelling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2014, 03:23 AM
  5. Loop through rows identifying a positive/negative pattern and return value
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 04:15 PM
  6. Using the .Pattern Method for identifying Strings
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2013, 07:20 PM

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