Home

Text Filter

%3CLINGO-SUB%20id%3D%22lingo-sub-713896%22%20slang%3D%22en-US%22%3EText%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-713896%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWould%20you%20be%20able%20to%20tell%20me%20how%20to%20filter%20two%20columns%20of%20individual%20names%20for%20differences%2C%20that%20rule%20out%20middle%20initials%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20using%20a%20filter%20that%20would%20tell%20me%20if%20the%20names%20were%20essentially%20the%20same%20but%20I%20received%20%22false%22%20results%20including%20names%20that%20were%20only%20differentiated%20due%20to%20a%20middle%20initial...%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-713896%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714044%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714044%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20try%20this%20formula%20to%20compare%20two%20names%20regardless%20of%20the%20middle%20initial%3A%3C%2FP%3E%3CPRE%3E%3DTRIM(LEFT(A1%2CFIND(%22%20%22%2CLOWER(A1)%2C1)))%20%26amp%3B%20%22%20%22%20%26amp%3B%20TRIM(MID(A1%2CFIND(%22%20%22%2CLOWER(A1)%2CFIND(%22%20%22%2CLOWER(A1)%2C1)%2B1)%2B1%2CLEN(A1)-FIND(%22%20%22%2CLOWER(A1)%2C1)%2B1))%3DTRIM(LEFT(B1%2CFIND(%22%20%22%2CLOWER(B1)%2C1)))%20%26amp%3B%20%22%20%22%20%26amp%3B%20TRIM(MID(B1%2CFIND(%22%20%22%2CLOWER(B1)%2CFIND(%22%20%22%2CLOWER(B1)%2C1)%2B1)%2B1%2CLEN(B1)-FIND(%22%20%22%2CLOWER(B1)%2C1)%2B1))%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20858px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120118i906E663CC1AA9172%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Compare%20two%20names%20regardless%20of%20the%20middle%20initial.png%22%20title%3D%22Compare%20two%20names%20regardless%20of%20the%20middle%20initial.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20is%20found%20in%20this%20%3CA%20href%3D%22https%3A%2F%2Fwww.extendoffice.com%2Fdocuments%2Fexcel%2F1779-excel-remove-middle-initial.html%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Elink%3C%2FA%3E%2C%20I've%20applied%20it%20on%20two%20cells%20and%20compare%20them%20in%20terms%20of%20equality%20using%20%3D%20sign.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714082%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714082%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%20I'll%20give%20it%20a%20whirl%20and%20let%20you%20know%20what%20transpires%20%3A)%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714094%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714094%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20tweak%20the%20formula%20to%20list%20names%20as%20last%2C%20first%2C%20middle%20initial%3F%20The%20formula%20works%20except%20it%20still%20shows%20false%20for%20names%20listed%20not%20exactly%20the%20same...%20for%20example%20Jones%20Santa%20C%20is%20false%20to%20Jones%20Santa...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714300%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714300%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20seems%20difficult%20to%20add%20this%20odd%20case%20to%20the%20formula%2C%20so%20I%20suggest%20to%20separate%20the%20names%20that%20have%20the%20initial%20in%20the%20last%20in%20a%20separate%20sheet%20and%20compare%20them%20using%20the%20below%20formula.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EOr%20alternatively%3C%2FSPAN%3E%3C%2FSPAN%3E%2C%20you%20can%20add%20it%20in%20the%20next%20column%20next%20to%20the%20previous%20formula%20as%20a%20second%20check.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3DIF(LEN(TRIM(A1))-LEN(TRIM(SUBSTITUTE(A1%2C%22%20%22%2C%22%22)))%2B1%3D3%2CTRIM(SUBSTITUTE(A1%2CMID(A1%2CLEN(A1)-1%2C2)%2C%22%22))%2CA1)%3DIF(LEN(TRIM(B1))-LEN(TRIM(SUBSTITUTE(B1%2C%22%20%22%2C%22%22)))%2B1%3D3%2CTRIM(SUBSTITUTE(B1%2CMID(B1%2CLEN(B1)-1%2C2)%2C%22%22))%2CB1)%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120145i6FE7D0717194A751%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Compare%20two%20names%20regardless%20of%20the%20middle%20initial%202.png%22%20title%3D%22Compare%20two%20names%20regardless%20of%20the%20middle%20initial%202.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EHope%20that%20helps%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714372%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714372%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20really%20appreciate%20your%20help!!!%20I'll%20give%20it%20a%20try%20%3A)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715110%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715110%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20absence%20of%20extra%20spaces%2C%20this%20formula%20returns%20your%20desired%20result%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DIF(LEN(A2)%3DLEN(B2)%2CLEFT(A2%2CLEN(A2)-1)%3DLEFT(B2%2CLEN(B2)-1)%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EIF(LEN(A2)%26gt%3BLEN(B2)%2CISNUMBER(FIND(B2%2CA2))%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EISNUMBER(FIND(A2%2CB2))))%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ESee%20the%20examples%20in%20the%20attached%20file%20and%20inform%20me%20of%20your%20thoughts%20thereon.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715231%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715231%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EWarning%3C%2FSTRONG%3E%3A%20This%20is%20an%20experiment%20testing%20formulas%20using%20modern%20Dynamic%20Arrays.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3En%3A%20%3CFONT%3E%3CSTRONG%3E%3D%20LEN(%40testName)%3C%2FSTRONG%3E%3B%20%3CEM%3Eselect%20a%20name%20from%20the%20column%20headers%20and%20determine%20its%20length%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3Ek%3A%20%3D%20%3CSTRONG%3ESEQUENCE(1%2Cn)%3C%2FSTRONG%3E%3B%20%3CEM%3Edefine%20a%20sequence%20counter%20for%20characters%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3Echr%3A%20%3CSTRONG%3E%3D%20MID(%20%40testName%2C%20k%2C%201%20)%3C%2FSTRONG%3E%3B%20%3CEM%3Esplit%20the%20test%20name%20into%20separate%20characters%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EfirstName%3A%20%3D%20%3CSTRONG%3ELEFT(%20%40testName%2C%20MIN(%20IF(%20chr%3D%22%20%22%2C%20k%20)%20)%20)%3C%2FSTRONG%3E%3B%20%3CEM%3Eextract%20first%20name%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3ElastName%3A%20%3CSTRONG%3E%3D%20RIGHT(%20%40testName%2C%20n%20-%20MAX(IF(%20chr%3D%22%20%22%2C%20k%20)%20)%20)%3C%2FSTRONG%3E%3B%20%3CEM%3Eextract%20last%20name%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EWorksheet%20formula%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20(%20LEFT(fullName%2C%20LEN(firstName))%20%3D%20firstName)%20*%20%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%26nbsp%3B%26nbsp%3B%20(RIGHT(fullName%2C%20LEN(lastName))%20%3D%20lastName)%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CEM%3Ec%3C%2FEM%3E%3CFONT%3E%3CEM%3Eompares%20an%20array%20of%20full%20names%20against%20the%20test%20name%3C%2FEM%3E.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3ETom%20B.%20Jones%3C%2FTD%3E%3CTD%3EJames%20A%20Smith%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ETom%20H%20Jones%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EJames%20B.%20Jones%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ETom%20B%20Jones%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EChris%20Williams%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EJames%20Smith%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EJames%20X.%20L.%20Smith%3C%2FTD%3E%3CTD%3E0%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715457%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715457%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20to%20demonstrate%20that%20my%20post%20above%20wasn't%20merely%20the%20product%20of%20a%20deranged%20mind%2C%20I%20attach%20a%20functioning%20workbook%20(%3CEM%3Estandard%20installation%20rather%20than%20insider%3C%2FEM%3E).%26nbsp%3B%20The%20name%20'testName'%20is%20now%20a%20relative%20reference%20to%20a%20cell%20in%20the%20column%20header%20and%20the%20sequence%20'k'%20is%20now%20somewhat%20more%20turgid%3C%2FP%3E%3CP%3Ek%3A%20%3CSTRONG%3E%3CFONT%3E%3DCOLUMN(%20INDEX(aRow%2C1)%3AINDEX(aRow%2Cn))%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3E%5Bnot%20that%20a%20number%20sequence%20should%20rely%20upon%20the%20definition%20of%20a%20somewhat%20arbitrary%20range%5D%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715476%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715476%22%20slang%3D%22en-US%22%3E%3CP%3EFor%20the%20collection%2C%20Power%20Query%20variant%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20440px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120356iDAF9114D643E3D05%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eby%3C%2FP%3E%0A%3CPRE%3Elet%0A%20%20%20%20Source%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22Names%22%5D%7D%5BContent%5D%2C%0A%20%20%20%20RemoveMiddle%20%3D%20Table.AddColumn(Source%2C%20%22Different%20Names%22%2C%20each%0A%20%20%20%20%20%20%20%20let%0A%20%20%20%20%20%20%20%20%20%20%20%20splitNames%20%3D%20Splitter.SplitTextByDelimiter(%22%20%22%2C%20QuoteStyle.None)(%5BNames%5D)%0A%20%20%20%20%20%20%20%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20Text.Combine(%7BsplitNames%7B0%7D%2C%20%22%20%22%2C%20List.Last(splitNames)%7D)%2C%0A%20%20%20%20type%20text)%2C%0A%20%20%20%20RemoveDuplicates%20%3D%20Table.Distinct(RemoveMiddle%2C%20%7B%22Different%20Names%22%7D)%2C%0A%20%20%20%20RemoveSource%20%3D%20Table.SelectColumns(RemoveDuplicates%2C%7B%22Different%20Names%22%7D)%0Ain%0A%20%20%20%20RemoveSource%3C%2FPRE%3E%0A%3CP%3EActually%20no%20coding%20is%20required%2C%20script%20is%20generated%20by%20Column%20By%20Example.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715565%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715565%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20you%20are%20correct%20in%20that%20PQ%20is%20the%20way%20to%20go%20with%20data%20analysis%20problems.%26nbsp%3B%20In%20particular%20I%20welcome%20the%20degree%20of%20structure%20offered%20by%20Tables%20and%20PQ%20that%20is%20missing%20from%20normal%20spreadsheet%20usage.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20though%2C%20DAs%20have%20hugely%20improved%20the%20usability%20of%20arrays%20for%20model%20building.%26nbsp%3B%20What%20is%20confusing%20is%20that%20the%20new%20DA%20functions%20also%20provide%20an%20alternative%20approach%20for%20data%20analysis%20steps%20(sorting%2C%20filtering%20%3CEM%3Eetc%3C%2FEM%3E).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20now%20a%20big%20area%20of%20overlap%20where%20either%20methodology%20is%20viable.%26nbsp%3B%20I%20am%20not%20certain%20where%20the%20borderlines%20are%20in%20terms%20of%20which%20option%20should%20be%20recommended%20for%20what%20problems.%26nbsp%3B%20At%20the%20moment%2C%20it%20is%20a%20case%20of%20trying%20each%20and%20determining%20on%20a%20case-by-case%20basis%20which%20works%20out%20the%20better.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718214%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718214%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20adjust%20this%20formula%20to%20rule%20out%20the%20middle%20initial%2Fname%20so%20that%20way%20the%20formula%20will%20only%20look%20for%20matching%20last%20name%20first%20name%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20data%20is%20listed%20in%20two%20columns%20with%20random%20names%20having%20only%20the%20middle%20initial%20or%20complete%20full%20middle%20name%20%E2%80%A6%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718230%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718230%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHello%20Sergei%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20example%20is%20great%20except%20I%20am%20needing%20to%20only%20find%20names%20that%20are%20different%20in%20two%20columns%20of%20names%2C%20where%20each%20name%20is%20listed%20side%20by%20side%20but%20could%20be%20listed%20different%20as%20Calendar%20Amy%20L%20or%20Calendar%20Amy%20Lynn%20%E2%80%A6%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718231%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718231%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Peter%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20extract%20the%20data%20without%20having%20to%20use%20test%20names%3F%20Each%20name%20in%20the%20two%20columns%20that%20I%20have%20are%20listed%20without%20any%20commas%20or%20other%20special%20characters%20as%20last%20name%20first%20name%20middle%20name%2Finitial...%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHoping%20to%20find%20a%20way%20to%20rule%20out%20same%20names%20that%20have%20a%20middle%20name%2Finitial%20listed...%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20Hampton%20Sally%20E%20shows%20false%20to%20Hampton%20Sally%20Egg...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20thoughts%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718506%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718506%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESample%20is%20in%20Sheet3%20attached%2C%20but%20I'm%20missed%20with%20the%20logic%3A%3C%2FP%3E%0A%3CP%3E-%20Are%20names%20always%20as%20LastName%20FirstName%20%3CMIDDLENAME%20or%3D%22%22%20initial%3D%22%22%3E%20where%20the%20latest%20is%20optional%3F%20Or%20that%20could%20be%20like%26nbsp%3BLastName%20%3CMIDDLENAME%3E%20FirstName%3F%3C%2FMIDDLENAME%3E%3C%2FMIDDLENAME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Names%20as%20%22%3CSPAN%3ECalendar%20Amy%20L%22%20and%20%22Calendar%20Amy%20Lynn%22%20are%20considered%20as%20the%20same.%20But%20what%20about%20%22Calendar%20Amy%20J%22%20or%20whatever%20is%20on%20the%20third%20position%20-%20is%20that%20the%20same%20%22Calendar%20Amy%22%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-718781%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-718781%22%20slang%3D%22en-US%22%3EYes%2C%20all%20names%20are%20listed%20last%20name%20first%20name%20middle%20initial%20suffix%20(if%20any)%20...%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20the%20middle%20initial%20is%20different%20then%20yes%20it%20is%20a%20different%20person...%3CBR%20%2F%3E%3CBR%20%2F%3EI%20really%20appreciate%20your%20help%20...%20let%20me%20know%20what%20you%20think.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-719248%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-719248%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20more%20question%20-%20if%20no%20initial%20%2F%20middle%20name%20this%20person%20consider%20as%20different%20to%20one%20who%20has%20no%20such%3F%20For%20example%3C%2FP%3E%0A%3CP%3E1)%26nbsp%3B%3CSPAN%3ECalendar%20Amy%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E2)%26nbsp%3BCalendar%20Amy%20L%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E3)%26nbsp%3BCalendar%20Amy%20Lynn%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E4)%26nbsp%3BCalendar%20Amy%20H%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E2)%20and%203)%20are%20the%20same.%204)%20is%20different%20from%202)%20and%203).%20What%20about%201)%2C%20is%20it%20different%20from%20all%20of%20them%20or%20it's%20the%20same%20as%202)%2C3)%20or%20same%20as%204)%20and%20if%20two%20latest%20options%20how%20we%20shall%20know%20which%20one%20to%20take.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-719551%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-719551%22%20slang%3D%22en-US%22%3EWell%2C%20the%20names%20are%20listed%20side%20by%20side%20so%20if%20the%20name%20was%20different%20it%20could%20show%20as%20follows%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1.%20Calendar%20Amy%20Calendar%20Amy%20L%3CBR%20%2F%3E2.%20Smith%20Santa%20C%20Smith%20Judy%3CBR%20%2F%3E3.%20Fan%20Tara%20D%20Fan%20Stan%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20names%20should%20only%20be%20compared%20row%20by%20row...%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20your%20example%2C%20the%20names%20will%20only%20be%20compared%20to%20one%20other%20name.%20So%2C%20we%20know%20if%201%20is%20referring%20to%202%2C%203%20or%204.%3CBR%20%2F%3E%3CBR%20%2F%3ELet%20me%20know%20if%20you%20have%20any%20other%20questions%20%3A)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-719955%22%20slang%3D%22en-US%22%3ERe%3A%20Text%20Filter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-719955%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364567%22%20target%3D%22_blank%22%3E%40AsiaY%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOkay%2C%20thank%20you%20for%20the%20clarification.%20If%20with%20Power%20Query%20the%20script%20is%20like%3C%2FP%3E%0A%3CPRE%3Elet%0A%20%20%20%20Source%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22Names%22%5D%7D%5BContent%5D%2C%0A%20%20%20%20ToText%20%3D%20Table.TransformColumnTypes(Source%2C%7B%7B%22Name%201%22%2C%20type%20text%7D%2C%20%7B%22Name%202%22%2C%20type%20text%7D%7D)%2C%0A%20%20%20%20CompareWithoutInitials%20%3D%20Table.AddColumn(ToText%2C%20%22Custom%22%2C%0A%20%20%20%20%20%20%20%20each%20Text.BeforeDelimiter(%5BName%201%5D%2C%20%22%20%22%2C%201)%3DText.BeforeDelimiter(%5BName%202%5D%2C%20%22%20%22%2C%201))%2C%0A%20%20%20%20FiltereTheSame%20%3D%20Table.SelectRows(CompareWithoutInitials%2C%20each%20(%5BCustom%5D%20%3D%20false))%2C%0A%20%20%20%20RemoveTemporaryColumns%20%3D%20Table.SelectColumns(FiltereTheSame%2C%7B%22Name%201%22%2C%20%22Name%202%22%7D)%0Ain%0A%20%20%20%20RemoveTemporaryColumns%3C%2FPRE%3E%0A%3CP%3EIf%20you'd%20like%20to%20have%20all%20different%20names%20in%20one%20column%20when%3C%2FP%3E%0A%3CPRE%3Elet%0A%20%20%20%20Source%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22Names%22%5D%7D%5BContent%5D%2C%0A%20%20%20%20InOneColumn%20%3D%20Table.FromList(List.Union(Table.ToColumns(Source))%2Cnull%2C%7B%22Names%22%7D)%2C%0A%20%20%20%20ToText%20%3D%20Table.TransformColumnTypes(InOneColumn%2C%7B%7B%22Names%22%2C%20type%20text%7D%7D)%2C%0A%20%20%20%20RemoveInitials%20%3D%20Table.ReplaceValue(ToText%2Ceach%20%5BNames%5D%2C%0A%20%20%20%20%20%20%20%20each%20Text.BeforeDelimiter(%5BNames%5D%2C%20%22%20%22%2C%201)%2CReplacer.ReplaceValue%2C%7B%22Names%22%7D)%2C%0A%20%20%20%20RemoveDuplicates%20%3D%20Table.Distinct(RemoveInitials)%0Ain%0A%20%20%20%20RemoveDuplicates%3C%2FPRE%3E%0A%3CP%3Eand%20the%20result%20is%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20533px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120589i000C00D609AC09A9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
AsiaY
Occasional Contributor

Hello All, 

 

Would you be able to tell me how to filter two columns of individual names for differences, that rule out middle initials? 

 

I've tried using a filter that would tell me if the names were essentially the same but I received "false" results including names that were only differentiated due to a middle initial... 

 

Any suggestions?

18 Replies

@AsiaY

 

Hi,

 

Please try this formula to compare two names regardless of the middle initial:

=TRIM(LEFT(A1,FIND(" ",LOWER(A1),1))) & " " & TRIM(MID(A1,FIND(" ",LOWER(A1),FIND(" ",LOWER(A1),1)+1)+1,LEN(A1)-FIND(" ",LOWER(A1),1)+1))=TRIM(LEFT(B1,FIND(" ",LOWER(B1),1))) & " " & TRIM(MID(B1,FIND(" ",LOWER(B1),FIND(" ",LOWER(B1),1)+1)+1,LEN(B1)-FIND(" ",LOWER(B1),1)+1))

Compare two names regardless of the middle initial.png

 

The formula is found in this link, I've applied it on two cells and compare them in terms of equality using = sign.

 

Regards

@Haytham Amairah 

 

Thanks! I'll give it a whirl and let you know what transpires :) 

@Haytham Amairah 

 

Is there a way to tweak the formula to list names as last, first, middle initial? The formula works except it still shows false for names listed not exactly the same... for example Jones Santa C is false to Jones Santa...

 

@AsiaY

 

It seems difficult to add this odd case to the formula, so I suggest to separate the names that have the initial in the last in a separate sheet and compare them using the below formula.

Or alternatively, you can add it in the next column next to the previous formula as a second check.

 

=IF(LEN(TRIM(A1))-LEN(TRIM(SUBSTITUTE(A1," ","")))+1=3,TRIM(SUBSTITUTE(A1,MID(A1,LEN(A1)-1,2),"")),A1)=IF(LEN(TRIM(B1))-LEN(TRIM(SUBSTITUTE(B1," ","")))+1=3,TRIM(SUBSTITUTE(B1,MID(B1,LEN(B1)-1,2),"")),B1)

Compare two names regardless of the middle initial 2.png

 

Hope that helps

@Haytham Amairah 

 

I really appreciate your help!!! I'll give it a try :)

@AsiaY 

In the absence of extra spaces, this formula returns your desired result: 

=IF(LEN(A2)=LEN(B2),LEFT(A2,LEN(A2)-1)=LEFT(B2,LEN(B2)-1),
IF(LEN(A2)>LEN(B2),ISNUMBER(FIND(B2,A2)),
ISNUMBER(FIND(A2,B2))))

See the examples in the attached file and inform me of your thoughts thereon. 

@AsiaY 

Warning: This is an experiment testing formulas using modern Dynamic Arrays.

 

n: = LEN(@testName); select a name from the column headers and determine its length

k: = SEQUENCE(1,n); define a sequence counter for characters

chr: = MID( @testName, k, 1 ); split the test name into separate characters

firstName: = LEFT( @testName, MIN( IF( chr=" ", k ) ) ); extract first name

lastName: = RIGHT( @testName, n - MAX(IF( chr=" ", k ) ) ); extract last name

Worksheet formula:

= ( LEFT(fullName, LEN(firstName)) = firstName) *

   (RIGHT(fullName, LEN(lastName)) = lastName);

compares an array of full names against the test name.

 

 Tom B. JonesJames A Smith
Tom H Jones10
James B. Jones00
Tom B Jones10
Chris Williams00
James Smith01
James X. L. Smith01

@AsiaY 

Just to demonstrate that my post above wasn't merely the product of a deranged mind, I attach a functioning workbook (standard installation rather than insider).  The name 'testName' is now a relative reference to a cell in the column header and the sequence 'k' is now somewhat more turgid

k: =COLUMN( INDEX(aRow,1):INDEX(aRow,n))

[not that a number sequence should rely upon the definition of a somewhat arbitrary range]

For the collection, Power Query variant

image.png

by

let
    Source = Excel.CurrentWorkbook(){[Name="Names"]}[Content],
    RemoveMiddle = Table.AddColumn(Source, "Different Names", each
        let
            splitNames = Splitter.SplitTextByDelimiter(" ", QuoteStyle.None)([Names])
        in
            Text.Combine({splitNames{0}, " ", List.Last(splitNames)}),
    type text),
    RemoveDuplicates = Table.Distinct(RemoveMiddle, {"Different Names"}),
    RemoveSource = Table.SelectColumns(RemoveDuplicates,{"Different Names"})
in
    RemoveSource

Actually no coding is required, script is generated by Column By Example.

@Sergei Baklan 

I think you are correct in that PQ is the way to go with data analysis problems.  In particular I welcome the degree of structure offered by Tables and PQ that is missing from normal spreadsheet usage.

 

Now though, DAs have hugely improved the usability of arrays for model building.  What is confusing is that the new DA functions also provide an alternative approach for data analysis steps (sorting, filtering etc). 

 

There is now a big area of overlap where either methodology is viable.  I am not certain where the borderlines are in terms of which option should be recommended for what problems.  At the moment, it is a case of trying each and determining on a case-by-case basis which works out the better.

@Twifoo 

 

Is there a way to adjust this formula to rule out the middle initial/name so that way the formula will only look for matching last name first name? 

 

The data is listed in two columns with random names having only the middle initial or complete full middle name … 

@Sergei Baklan 

 

Hello Sergei, 

 

Your example is great except I am needing to only find names that are different in two columns of names, where each name is listed side by side but could be listed different as Calendar Amy L or Calendar Amy Lynn … 

 

Any suggestions? 

@Peter Bartholomew 

 

Hi Peter, 

 

Is there a way to extract the data without having to use test names? Each name in the two columns that I have are listed without any commas or other special characters as last name first name middle name/initial... 

 

Hoping to find a way to rule out same names that have a middle name/initial listed... 

 

For example, Hampton Sally E shows false to Hampton Sally Egg...

 

Any thoughts? 

@AsiaY 

 

Sample is in Sheet3 attached, but I'm missed with the logic:

- Are names always as LastName FirstName <MiddleName or Initial> where the latest is optional? Or that could be like LastName <MiddleName> FirstName?

 

- Names as "Calendar Amy L" and "Calendar Amy Lynn" are considered as the same. But what about "Calendar Amy J" or whatever is on the third position - is that the same "Calendar Amy"?

Yes, all names are listed last name first name middle initial suffix (if any) ...

If the middle initial is different then yes it is a different person...

I really appreciate your help ... let me know what you think.

@AsiaY 

 

One more question - if no initial / middle name this person consider as different to one who has no such? For example

1) Calendar Amy

2) Calendar Amy L

3) Calendar Amy Lynn

4) Calendar Amy H

 

2) and 3) are the same. 4) is different from 2) and 3). What about 1), is it different from all of them or it's the same as 2),3) or same as 4) and if two latest options how we shall know which one to take.

 

Well, the names are listed side by side so if the name was different it could show as follows:

1. Calendar Amy Calendar Amy L
2. Smith Santa C Smith Judy
3. Fan Tara D Fan Stan

The names should only be compared row by row...

In your example, the names will only be compared to one other name. So, we know if 1 is referring to 2, 3 or 4.

Let me know if you have any other questions :)

@AsiaY 

 

Okay, thank you for the clarification. If with Power Query the script is like

let
    Source = Excel.CurrentWorkbook(){[Name="Names"]}[Content],
    ToText = Table.TransformColumnTypes(Source,{{"Name 1", type text}, {"Name 2", type text}}),
    CompareWithoutInitials = Table.AddColumn(ToText, "Custom",
        each Text.BeforeDelimiter([Name 1], " ", 1)=Text.BeforeDelimiter([Name 2], " ", 1)),
    FiltereTheSame = Table.SelectRows(CompareWithoutInitials, each ([Custom] = false)),
    RemoveTemporaryColumns = Table.SelectColumns(FiltereTheSame,{"Name 1", "Name 2"})
in
    RemoveTemporaryColumns

If you'd like to have all different names in one column when

let
    Source = Excel.CurrentWorkbook(){[Name="Names"]}[Content],
    InOneColumn = Table.FromList(List.Union(Table.ToColumns(Source)),null,{"Names"}),
    ToText = Table.TransformColumnTypes(InOneColumn,{{"Names", type text}}),
    RemoveInitials = Table.ReplaceValue(ToText,each [Names],
        each Text.BeforeDelimiter([Names], " ", 1),Replacer.ReplaceValue,{"Names"}),
    RemoveDuplicates = Table.Distinct(RemoveInitials)
in
    RemoveDuplicates

and the result is

image.png

Related Conversations