Results 1 to 6 of 6

excel formula produces duplicate last names

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    excel formula produces duplicate last names

    Hey all,

    I have an excel formula producing duplicate last names.

    For example, I have a list like this:
    Corn,Marlin
    Lizand,ROBERT H 
    CATANESE,SALVATORE J & OLGA M
    JIMENEZ,ALEJANDRO & HILDA M
    Hernara,Harry & Marie Anne Martin
    CORNWALL,A ROBERT & CORNWALL,ANNA
    When there is an ampersand names must get split into two columns, so i use the below formulas:
    =IF( ISERROR( SEARCH("&", A15) ), IF( ISERROR( SEARCH(" ", A15) ), A15, LEFT(A15,LOOKUP(2^15,FIND(" ",A15,ROW(INDIRECT("1:"&LEN(A15)))))-1)),SUBSTITUTE(A15,MID(A15,FIND(",",A15,1)+1,FIND("&",A15,1)-FIND(",",A15,1)),""))
    and:
    =IF(ISERR(FIND("&",A15,1)),"",LEFT(A15,FIND("&",A15,1)-1))
    This has the resulting effect:
    First column:
     
     
    Corn,Marlin	   
    Lizand,ROBERT H	   
    CATANESE, OLGA M	   
    JIMENEZ, HILDA M	     
    Hernara, Marie Anne Martin	   
    CORNWALL, CORNWALL,ANNA	 
    
    Second Column:   
    CATANESE,SALVATORE J 	   
    JIMENEZ,ALEJANDRO 	      
    Hernara,Harry 	   
    White,Alex 	   
    Martin,Harry 	   
    CORNWALL,A ROBERT
    As you can see, the formula causes a duplicate of the last name in the first column. Any suggestion to refine formula so it doesn't cause that duplicate, yet doesn't negatively impact the other results?

    Thanks for any response
    Last edited by johnmerlino; 11-04-2010 at 10:17 PM.

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