SOLVED
Home

Delete Rows Based On Cell Contents Matching Cell Contents in Other Worksheet

%3CLINGO-SUB%20id%3D%22lingo-sub-544357%22%20slang%3D%22en-US%22%3EDelete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-544357%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3EThis%20is%20my%20first%20visit%20and%20my%20first%20post%20in%20this%20group.%26nbsp%3B%20I%20haven't%20been%20able%20to%20find%20the%20answer%20to%20an%20issue%20I%20have%20so%20here%20I%20am.%26nbsp%3B%20I%20have%20worked%20with%20Excel%20and%20formulas%20for%20many%20years%20but%20I%20am%20stumped%20in%20figuring%20this%20one%20out.%26nbsp%3B%20Here%20is%20the%20scenario%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20contact%20list%20in%20one%20worksheet%20containing%20names%2C%20company%20and%20email%20address.%26nbsp%3B%20I%20have%20other%20worksheets%20which%20contain%20email%20addresses%20of%20contacts%20who%20have%20marked%20my%20emails%20as%20Spam%2C%20Unsubscribed%20or%20are%20undeliverable.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20challenge%20is%20to%20delete%20the%20rows%20in%20the%20main%20contact%20list%20that%20contain%20the%20email%20addresses%20that%20are%20found%20in%20the%20other%20worksheets.%26nbsp%3B%20I'm%20dealing%20with%20thousands%20of%20contacts%20and%20the%20list%20updates%20will%20be%20ongoing%20so%20I%20really%20need%20to%20automate%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20any%20help%20you%20can%20provide.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-544357%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-544529%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-544529%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F337613%22%20target%3D%22_blank%22%3E%40TPCTech%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eyou%20can%20do%20the%20following%3A%3C%2FP%3E%3CP%3E-%20make%20sure%20your%20main%20list%20is%20an%20Excel%20Table%3C%2FP%3E%3CP%3E-%20add%20one%20column%20to%20your%20contact%20list%26nbsp%3B%3C%2FP%3E%3CP%3E-%20in%20the%20columns%20added%2C%20write%20a%20formula%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3D%20IF(OR(ISNA(MATCH(email%20cell%2C%20email%20column%20in%20the%20%3CSPAN%3ESpam%26nbsp%3B%3C%2FSPAN%3Esheet%2C%200)%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20ISNA(MATCH(email%20cell%2C%20email%20column%20in%20the%20%3CSPAN%3EUnsubscribed%20%3C%2FSPAN%3Esheet%2C%200)%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20ISNA(MATCH(email%20cell%2C%20email%20column%20in%20the%20%3CSPAN%3EUndeliverable%3C%2FSPAN%3Esheet%2C%200)%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20)%2C%22delete%22%2C%20%22%22)%3C%2FP%3E%3CP%3E-%20you%20should%20get%20the%20word%20%22delete%22%20in%20all%20the%20rows%20that%20have%20an%20email%20that%20is%20included%20in%20at%20least%20one%20of%20the%20other%203%20sheets.%3C%2FP%3E%3CP%3E-%20filter%20the%20table%20in%20the%20column%20by%20%22delete%22%20and%20deleted%20the%20rows%20filtered%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20this%20works.%20Good%20luck!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-548822%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-548822%22%20slang%3D%22en-US%22%3EThanks!%20That%20makes%20sense%20to%20me.%20I'll%20give%20it%20a%20shot.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-549528%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-549528%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B!%26nbsp%3B%20That%20got%20me%20going%20and%20I%20really%20appreciate%20the%20response%20and%20solution.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-549567%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-549567%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F337613%22%20target%3D%22_blank%22%3E%40TPCTech%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReally%20glad%20that%20I%20could%20help!%20Thank%20you%20for%20the%20feedback!%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-885098%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-885098%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20I%20must%20try.%20I%20am%20trying%20to%20delete%20the%20rows%20from%20one%20worksheet%20(MD%20and%20VA%20Contacts%20CSV)%20because%20the%20row%20contain%20any%20word%20or%20phrase%20from%20another%20list%20worksheet%20(Expired%20Contact%20Information%20List).%20Thank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-885129%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-885129%22%20slang%3D%22en-US%22%3E%3CP%3EWhat%20did%20I%20do%20incorrectly%20I%20receive%26nbsp%3Bthe%20response%20too%20many%20Arguments%3F%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%20IF(OR(ISNA(MATCH(A1..A56%2C%201059271022-domain-invalid%2C%200)%2C)%2C%22delete%22%2C%20%22%22)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-887746%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-887746%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%2C%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F417800%22%20target%3D%22_blank%22%3E%40RodwellSmith%3C%2FA%3E%3C%2FP%3E%3CP%3EPlease%20try%20the%20following%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20IF(ISNA(MATCH(cell%20with%20email%20address%20to%20search%20for%20on%20second%20sheet%2C%20column%20with%20emails%20on%20second%20sheet%2C%200))%2C%22delete%22%2C%20%22%22)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20if%20the%20first%20email%20address%20that%20you%20want%20to%20check%20is%20on%20cell%20A1%20of%20sheet1%20and%20the%20column%20with%20emails%20in%20sheet2%20is%20column%20C%2C%20write%20this%20formula%20in%20the%20column%20of%20sheet%201%20where%20you%20want%20to%20run%20the%20check%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20IF(ISNA(MATCH(A1%2C%20'Sheet2!'C%3AC%2C%200))%2C%22delete%22%2C%20%22%22)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20it%20doesn't%20work%2C%20please%20feel%20free%20to%20send%20the%20file%20with%20some%20mock%20data%20and%20I'll%20see%20if%20I%20can%20help%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-887827%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-887827%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20very%20much%20for%20replying%2C%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20rearrange%20and%20table%20the%20format%20to%20have%20both%20sheets%20in%20the%20same%20workbook.%20%22Sheet%201%22%20is%20the%20cell%20with%20the%20subject%20%22invalid%20domain%22%20to%20search%20for%20then%20delete%20row%20from%20registered%20contacts%20or%20%22Sheet%202%22.%20(Pardon%20me%2C%20I%20renamed%20the%20sheets%20to%20keep%20my%20focus)%26nbsp%3B%20Here%20is%20the%20new%20formulary%20accordingly%3C%2FP%3E%3CP%3E%26nbsp%3B%20%3CFONT%3E%3D%20IF(ISNA(MATCH(A1%2C%20Sheet%202!'E%3AE%2C%200))%2C%22delete%22%2C%20%22%22)%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EI%20think%20we%20are%20onto%20something%20now!%20However%2C%20so%20I%20am%20not%20mistaken%3B%20which%20sheet%20am%20I%20making%20the%20column%20that%20will%20contain%20the%20word%20%22delete%22%20I%20tried%20both%20sheets%20and%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3E%26nbsp%3B%3D%20IF(ISNA(MATCH(A1%2C%20'Sheet2!'E%3AE%2C%200))%2C%22delete%22%2C%20%22%22)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3Ethen%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3E%26nbsp%3B%3D%20IF(ISNA(MATCH('Sheet%201!'A1%2C%20'Sheet2!'E%3AE%2C%200))%2C%22delete%22%2C%20%22%22)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EI%20think%20I%20may%20have%20missed%20something%20in%20placing%20the%20formula.%20Please%20find%20attached%20two%20snippets%20with%20Excel's%20responses.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EAgainThank%20you%20for%20helping%20me.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-890338%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-890338%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F417800%22%20target%3D%22_blank%22%3E%40RodwellSmith%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20put%20the%20formula%20in%20either%20sheet%2C%20depending%20on%20what%20you%20need.%20It%20seems%20that%20you%20still%20need%20to%20do%20other%20things%2C%20first.%20You%20mentioned%20domains%20and%20registered%20contacts.%20MATCH%20will%20look%20for%20the%20same%20string%20in%20the%20column%20that%20you%20indicate.%20For%20example%2C%20in%20your%20first%20formula%2C%20if%20you%20have%20an%20email%20address%20in%20cell%20A1%2C%20the%20formula%20will%20look%20for%20that%20same%20string%20of%20email%20address%20in%20column%20E%20of%20sheet2.%20If%20that%20email%20address%20does%20not%20exist%20in%20column%20E%2C%20then%20the%20formula%20return%20an%20error%20(N%2FA)%3C%2FP%3E%3CP%3EIn%20that%20case%2C%20the%20formula%20ISNA%20returns%20value%20True.%3C%2FP%3E%3CP%3EFinally%2C%20the%20formula%20IF%20will%20return%20%22delete.%22%3C%2FP%3E%3CP%3EThis%20would%20mean%20that%20you%20are%20looking%20to%20delete%20the%20email%20address%20in%20cell%20A1.%20Of%20course%2C%20the%20formula%20does%20not%20delete%20the%20email%20address%20from%20Sheet2%2C%20only%20makes%20note%20of%20it.%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20it%20is%20not%20quite%20this%20you%20are%20looking%20for...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-890703%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-890703%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20making%20more%20sense%20of%20this%20than%20I%20could.%20the%20email%20addresses%20I%20am%20trying%20to%20delete%20from%20the%20registration%20data%20are%20from%20expired%20domains.%20I%20have%20been%20experimenting%20with%20how%20to%20delete%20them%20from%20Sheet-2%20which%20has%20the%20table%20of%20registrants.%20Sheet-1%20has%20the%20list%20of%20emails%20from%20inactive%20domains.%20I%20have%20versed%20the%20formula%20so%20I%20can%20make%20sense%20and%20focus%20on%20the%20objective.%20Sheet-1%20will%20change%20but%20I%20wish%20to%20maintain%20Sheet2%20less%20the%20rows%20deleted%20by%20the%20objective%20formula%3A%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%224%22%3EHow%20could%20I%20write%20this%20formula%20in%20Excel%3F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%224%22%3E%22If%20contents%20of%20a%20cell%20on%20Sheet-1%20(say%20A1)%20%3CSPAN%3Ematch%3C%2FSPAN%3E%20any%20content%20of%20cells%20in%20column%20E%20on%20Sheet-2%20(say%20E2..E15000)%20delete%20the%20entire%20row%20on%20Sheet-2%22%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-909046%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-909046%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F417800%22%20target%3D%22_blank%22%3E%40RodwellSmith%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20for%20the%20delay%20in%20responding.%3C%2FP%3E%3CP%3EThere%20is%20no%20formula%20to%20delete%20a%20row.%20you%20can%20use%20formulas%20to%20point%20you%20the%20rows%20that%20have%20data%20that%20you%20want%20to%20delete%2C%20but%20a%20formula%20won't%20perform%20that%20action%20for%20you.%20For%20that%2C%20you%20would%20have%20to%20use%20a%20macro%20that%20can%20be%20written%20with%20VBA%20programming%20language.%3C%2FP%3E%3CP%3EDoes%20it%20make%20sense%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1063156%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1063156%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20my%20question%20is%20related%20to%20this%20thread.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20couldn't%20figure%20out%20how%20to%20attach%20a%20file%20so%20I%20just%20took%20an%20example%20snip.%26nbsp%3B%26nbsp%3B%3CSPAN%3EI'm%20trying%20to%20scrub%20the%20list%20of%20certain%20zip%20codes.%26nbsp%3B%20If%20the%20zip%20code%20in%20Sheet1%20column%20I%20equals%2068110%20or%2068111%2C%20I%20want%20to%20remove%20the%20row%20%26amp%3B%20transfer%20it%20to%20Sheet2.%26nbsp%3B%20Is%20there%20a%20formula%20that%20can%20do%20that%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20this%20is%20possible%2C%20someone%20could%20then%20just%20delete%20Sheet2%2C%20thus%20solving%20the%20delete%20row.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20760px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F161451iC0CDF46B2F64158D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Excel%20snip.JPG%22%20title%3D%22Excel%20snip.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1064849%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1064849%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F485845%22%20target%3D%22_blank%22%3E%40fuhrung%3C%2FA%3E%3CBR%20%2F%3EThere%20is%20no%20formula%20that%20makes%20data%20disappear%20from%20one%20place%20and%20reappear%20in%20another%20place.%20Only%20VBA%20could%20do%20that.%20But%20maybe%20we%20can%20think%20this%20problem%20on%20a%20different%20way.%20What%20is%20that%20you%20are%20trying%20to%20accomplish%3F%20Do%20you%20really%20need%20to%20delete%20those%20codes%3F%20It%20seems%20that%20what%20you%20need%20is%20a%20%22clean%22%20version%20of%20your%20data%20without%20the%20entries%20with%20those%20codes.%20Is%20this%20correct%3F%20If%20yes%2C%20then%20what%20we%20can%20do%20is%20to%20leave%20your%20data%20where%20it%20is%20and%20create%20a%20list%2C%20on%20a%20separate%20sheet%20with%20only%20the%20entries%20that%20you%20want%20to%20keep%20instead%20of%20the%20ones%20that%20you%20don't%20want.%20There%20are%20different%20ways%20to%20accomplish%20that.%3CBR%20%2F%3EQuestions%3A%3CBR%20%2F%3E1%20-%20how%20long%20is%20your%20data%20list%3F%3CBR%20%2F%3E2%20-%20is%20this%20a%20one-time%20task%20or%20do%20you%20need%20to%20repeat%20it%20frequently%20with%20a%20new%20set%20of%20data%3F%3CBR%20%2F%3E3%20-%20which%20version%20of%20Excel%20do%20you%20have%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1065432%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1065432%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%3CBR%20%2F%3EI%20download%20lists%20like%20these%20from%20county%20websites%20so%20I%20can%20send%20mail%20to%20them%20as%20I'm%20a%20real%20estate%20investor.%20This%20one%20in%20particular%20has%201400%2B%20entries%2C%20houses%20with%20code%20violations.%20Those%202%20zip%20codes%20within%20the%20list%20are%20areas%20I%20do%20NOT%20want%20to%20waste%20marketing%20%24%20mailing%20to%2C%20because%20it's%20in%20an%20area%20I%20dont%20want%20to%20buy%20in%2C%20due%20to%20high%20crime%20rate%2C%20etc.%20So%20I%20need%20a%20way%20I%20can%20remove%20the%20rows%20with%20those%20zip%20codes%2C%20so%20I%20can%20then%20send%20the%20%22scrubbed%22%20list%20to%20my%20mail%20fulfillment%20company.%20Hopefully%20that%20wasn't%20overly%20detailed%20lol.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1065443%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1065443%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%3CBR%20%2F%3EAnd%20I%20have%20Excel%202007%20%26amp%3B%202016%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1068097%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1068097%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F485845%22%20target%3D%22_blank%22%3E%40fuhrung%3C%2FA%3E%2C%20no%20overly%20detailed%20at%20all!%20It%20is%20important%20to%20understand%20the%20procedure.%20A%20small%20detail%20can%20make%20all%20the%20difference%20to%20the%20approach%20chosen%20to%20solve%20the%20problem.%3C%2FP%3E%3CP%3ESince%20you%20have%20Excel%202016%2C%26nbsp%3Byour%20data%20is%20not%20always%20structured%20the%20very%20same%20way%2C%20and%20for%20some%20sets%20of%20data%2C%20it%20seems%20this%20is%20a%20one-time%20task%2C%20I%20would%20suggest%20going%20with%20Power%20Query%2C%20which%20is%20a%20built-in%20tool%20in%20Excel%20newer%20versions.%20I%20would%20like%20to%20offer%20you%2030%20minutes%20of%20free%20training%20online%20to%20teach%20you%20some%20the%20basics%20of%20Power%20Query%20that%20you%20need%20to%20know%20to%20be%20able%20to%20perform%20this%20data%20cleansing%20operation.%20There%20is%20also%20the%20option%20of%20just%20filtering%20a%20table.%20Which%20is%20even%20simpler%20and%20still%20efficient.%20In%26nbsp%3Bexchange%2C%20I%20would%20ask%20you%20to%20post%20here%20the%20description%20of%20the%20process%20after%20you%20learn%20it.%20It%20seems%20that%20several%20people%20are%20looking%20for%20the%20answer%20to%20similar%20problems%2C%20and%20this%20would%20be%20the%20best%20way%20to%20help%20them%20too.%20What%20do%20you%20think%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1072828%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1072828%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F302344%22%20target%3D%22_blank%22%3E%40Celia_Alves%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20good%20with%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1078587%22%20slang%3D%22en-US%22%3ERe%3A%20Delete%20Rows%20Based%20On%20Cell%20Contents%20Matching%20Cell%20Contents%20in%20Other%20Worksheet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1078587%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F485845%22%20target%3D%22_blank%22%3E%40fuhrung%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreat!%20I%20will%20send%20you%20a%20private%20message%20to%20schedule.%3C%2FP%3E%3C%2FLINGO-BODY%3E
TPCTech
New Contributor

Hello All,

This is my first visit and my first post in this group.  I haven't been able to find the answer to an issue I have so here I am.  I have worked with Excel and formulas for many years but I am stumped in figuring this one out.  Here is the scenario:

 

I have a contact list in one worksheet containing names, company and email address.  I have other worksheets which contain email addresses of contacts who have marked my emails as Spam, Unsubscribed or are undeliverable.

 

My challenge is to delete the rows in the main contact list that contain the email addresses that are found in the other worksheets.  I'm dealing with thousands of contacts and the list updates will be ongoing so I really need to automate this.

 

Thanks for any help you can provide.

18 Replies
Solution

@TPCTech 

you can do the following:

- make sure your main list is an Excel Table

- add one column to your contact list 

- in the columns added, write a formula like this:

       = IF(OR(ISNA(MATCH(email cell, email column in the Spam sheet, 0),

                    ISNA(MATCH(email cell, email column in the Unsubscribed sheet, 0),

                    ISNA(MATCH(email cell, email column in the Undeliverablesheet, 0)

                    ),"delete", "")

- you should get the word "delete" in all the rows that have an email that is included in at least one of the other 3 sheets.

- filter the table in the column by "delete" and deleted the rows filtered

 

Let me know if this works. Good luck!

 

Thanks! That makes sense to me. I'll give it a shot.

Thanks @Celia_Alves !  That got me going and I really appreciate the response and solution.

@TPCTech 

Really glad that I could help! Thank you for the feedback! :-)

This I must try. I am trying to delete the rows from one worksheet (MD and VA Contacts CSV) because the row contain any word or phrase from another list worksheet (Expired Contact Information List). Thank you @Celia_Alves 

What did I do incorrectly I receive the response too many Arguments? @Celia_Alves 

= IF(OR(ISNA(MATCH(A1..A56, 1059271022-domain-invalid, 0),),"delete", "")

hi,@RodwellSmith

Please try the following: 

= IF(ISNA(MATCH(cell with email address to search for on second sheet, column with emails on second sheet, 0)),"delete", "")

 

For example, if the first email address that you want to check is on cell A1 of sheet1 and the column with emails in sheet2 is column C, write this formula in the column of sheet 1 where you want to run the check:

 

= IF(ISNA(MATCH(A1, 'Sheet2!'C:C, 0)),"delete", "")

 

If it doesn't work, please feel free to send the file with some mock data and I'll see if I can help you.

Thank you very much for replying,@Celia_Alves 

I have rearrange and table the format to have both sheets in the same workbook. "Sheet 1" is the cell with the subject "invalid domain" to search for then delete row from registered contacts or "Sheet 2". (Pardon me, I renamed the sheets to keep my focus)  Here is the new formulary accordingly

  = IF(ISNA(MATCH(A1, Sheet 2!'E:E, 0)),"delete", "")

I think we are onto something now! However, so I am not mistaken; which sheet am I making the column that will contain the word "delete" I tried both sheets and

 = IF(ISNA(MATCH(A1, 'Sheet2!'E:E, 0)),"delete", "")

then

 = IF(ISNA(MATCH('Sheet 1!'A1, 'Sheet2!'E:E, 0)),"delete", "")

I think I may have missed something in placing the formula. Please find attached two snippets with Excel's responses.

AgainThank you for helping me.

@RodwellSmith 

You can put the formula in either sheet, depending on what you need. It seems that you still need to do other things, first. You mentioned domains and registered contacts. MATCH will look for the same string in the column that you indicate. For example, in your first formula, if you have an email address in cell A1, the formula will look for that same string of email address in column E of sheet2. If that email address does not exist in column E, then the formula return an error (N/A)

In that case, the formula ISNA returns value True.

Finally, the formula IF will return "delete."

This would mean that you are looking to delete the email address in cell A1. Of course, the formula does not delete the email address from Sheet2, only makes note of it.

 

Maybe it is not quite this you are looking for...

 

 

 

 

@Celia_Alves 

Thank you for making more sense of this than I could. the email addresses I am trying to delete from the registration data are from expired domains. I have been experimenting with how to delete them from Sheet-2 which has the table of registrants. Sheet-1 has the list of emails from inactive domains. I have versed the formula so I can make sense and focus on the objective. Sheet-1 will change but I wish to maintain Sheet2 less the rows deleted by the objective formula:

How could I write this formula in Excel?

"If contents of a cell on Sheet-1 (say A1) match any content of cells in column E on Sheet-2 (say E2..E15000) delete the entire row on Sheet-2"

@RodwellSmith 

Sorry for the delay in responding.

There is no formula to delete a row. you can use formulas to point you the rows that have data that you want to delete, but a formula won't perform that action for you. For that, you would have to use a macro that can be written with VBA programming language.

Does it make sense?

 

@Celia_Alves 

I believe my question is related to this thread.

 

I couldn't figure out how to attach a file so I just took an example snip.  I'm trying to scrub the list of certain zip codes.  If the zip code in Sheet1 column I equals 68110 or 68111, I want to remove the row & transfer it to Sheet2.  Is there a formula that can do that?

 

If this is possible, someone could then just delete Sheet2, thus solving the delete row.

 

Excel snip.JPG

 

@fuhrung
There is no formula that makes data disappear from one place and reappear in another place. Only VBA could do that. But maybe we can think this problem on a different way. What is that you are trying to accomplish? Do you really need to delete those codes? It seems that what you need is a "clean" version of your data without the entries with those codes. Is this correct? If yes, then what we can do is to leave your data where it is and create a list, on a separate sheet with only the entries that you want to keep instead of the ones that you don't want. There are different ways to accomplish that.
Questions:
1 - how long is your data list?
2 - is this a one-time task or do you need to repeat it frequently with a new set of data?
3 - which version of Excel do you have?
@Celia_Alves
I download lists like these from county websites so I can send mail to them as I'm a real estate investor. This one in particular has 1400+ entries, houses with code violations. Those 2 zip codes within the list are areas I do NOT want to waste marketing $ mailing to, because it's in an area I dont want to buy in, due to high crime rate, etc. So I need a way I can remove the rows with those zip codes, so I can then send the "scrubbed" list to my mail fulfillment company. Hopefully that wasn't overly detailed lol.

@fuhrung, no overly detailed at all! It is important to understand the procedure. A small detail can make all the difference to the approach chosen to solve the problem.

Since you have Excel 2016, your data is not always structured the very same way, and for some sets of data, it seems this is a one-time task, I would suggest going with Power Query, which is a built-in tool in Excel newer versions. I would like to offer you 30 minutes of free training online to teach you some the basics of Power Query that you need to know to be able to perform this data cleansing operation. There is also the option of just filtering a table. Which is even simpler and still efficient. In exchange, I would ask you to post here the description of the process after you learn it. It seems that several people are looking for the answer to similar problems, and this would be the best way to help them too. What do you think?

@fuhrung 

Great! I will send you a private message to schedule.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
50 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
32 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
15 Replies
Dev channel update to 80.0.355.1 is live
josh_bodner in Discussions on
67 Replies