Any way to check for duplicate character patterns in a cell?
Hey all,
I have a formula, which basically concatenates the first name and middle initial to right of ampersand with the last name to left of ampersand if an ampersand exists in cell: Code:
=IF( ISERROR( SEARCH("&", A1) ), IF( ISERROR( SEARCH(" ", A1) ), A1, LEFT(A1,LOOKUP(2^15,FIND(" ",A1,ROW(INDIRECT("1:"&LEN(A1)))))-1)),SUBSTITUTE(A1,MID(A1,FIND(",",A1,1)+1,FIND("&",A1,1)-FIND(",",A1,1)),"")) Code:
CORNWALL,CORNWALL,ANNA CORNWALL,A ROBERT & CORNWALL,ANNA It stringed together CORNWALL as the last name and CORNWALL as the first name. Is there a way to check for the following pattern using excel formulas: [name],[name], and replace with [name], I'm just trying to avoid duplicate last names. Thanks for response. |
Quote:
|
All times are GMT +1. The time now is 07:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com