SOLVED
Home

Email List: Need Help Fixing An Email List With A Formula

%3CLINGO-SUB%20id%3D%22lingo-sub-427304%22%20slang%3D%22en-US%22%3EEmail%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-427304%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20an%20email%20list%20where%20the%20last%20names%20do%20not%20match%20the%20emails.%20I%20need%20a%20formula%20that%20rescrambles%20the%20list%20to%20match%20the%20correct%20last%20name.%20I%20attached%20a%20sample%20sheet.%20I%20need%20the%20formula%20in%20Column%20D.%20So%20D2%26nbsp%3B%20should%20%3D%20C4%20(mlevine345%40gmail.com).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-427304%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-428420%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428420%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F318482%22%20target%3D%22_blank%22%3E%40mlevine3%3C%2FA%3E%26nbsp%3B%2C%20the%20issue%20is%20you%20have%20no%20same%20rule%20for%20all%20emails%2C%20For%20example%2C%20for%20Russell%20Westbrook%20email%20starts%20from%20russell45%2C%20not%20from%20rwestbrook%20as%20it%20is%20for%20other%20people.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%20you%20could%20first%20sort%20your%20columns%20A%20and%20B%20in%20ascending%20order%2C%20after%20that%20to%20sort%20only%20column%20C%20(without%20expansion)%20-%20that%20could%20be%20good%20enough.%20See%20second%20sheet%20in%20attached%20transformed%20as%20above.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-428826%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-428826%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%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E.%20Unfortunately%20you%20are%20correct.%20There%20is%20no%20unique%20identifier.%20The%20document%20I%20sent%20was%20a%20small%20sample%20of%20the%2022%2C000%20records%20I%20have%20in%20the%20main%20list.%20Although%20your%20solution%20works%20with%20the%20small%20sample%2C%20it%20doesn't%20carry%20over%20to%20the%20full%20list%20due%20to%20missing%20records%2C%20duplicate%20last%20names%2C%20strange%20email%20strings%2C%20etc.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEssentially%20I%20want%20to%20be%20able%20to%20search%20a%20string%20column%20C%20for%20a%20matching%20last%20name%20in%20column%20B%20and%20return%20the%20result%20in%20column%20D.%20If%20there's%20no%20match%20(such%20as%20a%20first%20name%20as%20the%20email%20or%20a%20missing%20record%20it%20should%20return%20an%20error%2C%20or%20blank).%20I%20was%20thinking%20some%20kind%20of%20index%20partial%20match%20such%20as%26nbsp%3B%3DINDEX(C2%3AC6%2CMATCH(%22*%22%26amp%3BB2%26amp%3B%22*%22%2CB2%3AB6%2C0))%2C%20but%20this%20didn't%20work.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-429564%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-429564%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F318482%22%20target%3D%22_blank%22%3E%40mlevine3%3C%2FA%3E%26nbsp%3B%2C%20if%20use%20your%20idea%20that%20could%20be%3C%2FP%3E%0A%3CPRE%3E%3DIFNA(INDEX(%24C%242%3A%24C%2430%2CMATCH(1%2CINDEX(1*ISNUMBER(SEARCH(%24B2%2C%24C%242%3A%24C%2430))%2C0)%2C0))%2C%22%3Dno%20such%3D%3D%22)%3C%2FPRE%3E%0A%3CP%3EI%20didn't%20check%20blank%20last%20names%20here.%20Also%20not%20exact%20approximation.%20If%2C%20for%20example%2C%20you%20have%20Joe%20Smith%2C%20John%20Smith%20and%20Peter%20Smith.%3C%2FP%3E%0A%3CP%3EPlease%20see%20in%20the%20first%20sheet%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-430208%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-430208%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20so%20much%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.%20This%20formula%20works%20and%20is%20the%20best%20solution%20to%20my%20problem.%20Unfortunately%20I%20have%20way%20more%20duplicate%20last%20names%20than%20I%20thought.%20Also%20some%20last%20names%20like%20%22Hager%22%20fit%20within%20an%20email%20address%20containing%20%22Hagerty%22%20and%20other%20short%20last%20names%20are%20giving%20me%20problems.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20not%20a%20perfect%20solution%20but%20it%20helps%20for%20now.%20Thank%20you%20very%20much.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-430597%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20List%3A%20Need%20Help%20Fixing%20An%20Email%20List%20With%20A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-430597%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F318482%22%20target%3D%22_blank%22%3E%40mlevine3%3C%2FA%3E%26nbsp%3B%2C%20yes%2C%20that's%20more%20about%20%22business%20logic%22%20rather%20than%20Excel%20formulas%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

I have an email list where the last names do not match the emails. I need a formula that rescrambles the list to match the correct last name. I attached a sample sheet. I need the formula in Column D. So D2  should = C4 (mlevine345@gmail.com). 

 

Thank you for your help in advance!

5 Replies

@Deleted , the issue is you have no same rule for all emails, For example, for Russell Westbrook email starts from russell45, not from rwestbrook as it is for other people.

 

As variant you could first sort your columns A and B in ascending order, after that to sort only column C (without expansion) - that could be good enough. See second sheet in attached transformed as above.

Thanks @Sergei Baklan. Unfortunately you are correct. There is no unique identifier. The document I sent was a small sample of the 22,000 records I have in the main list. Although your solution works with the small sample, it doesn't carry over to the full list due to missing records, duplicate last names, strange email strings, etc. 

 

Essentially I want to be able to search a string column C for a matching last name in column B and return the result in column D. If there's no match (such as a first name as the email or a missing record it should return an error, or blank). I was thinking some kind of index partial match such as =INDEX(C2:C6,MATCH("*"&B2&"*",B2:B6,0)), but this didn't work. 

 

Solution

@Deleted , if use your idea that could be

=IFNA(INDEX($C$2:$C$30,MATCH(1,INDEX(1*ISNUMBER(SEARCH($B2,$C$2:$C$30)),0),0)),"=no such==")

I didn't check blank last names here. Also not exact approximation. If, for example, you have Joe Smith, John Smith and Peter Smith.

Please see in the first sheet attached.

Thanks so much@Sergei Baklan. This formula works and is the best solution to my problem. Unfortunately I have way more duplicate last names than I thought. Also some last names like "Hager" fit within an email address containing "Hagerty" and other short last names are giving me problems. 

 

It's not a perfect solution but it helps for now. Thank you very much. 

@Deleted , yes, that's more about "business logic" rather than Excel formulas