0

Legend: (this is across multiple worksheets, but for simplicity's sake will reference as below)

Each column has a header.
Column A: List of Names
Column F: List of Email Addresses
Column T: FILTER formula, which will produce same names that appear in column A

In column T, I have a FILTER formula, which populates with a list of people's names. (since this is a FILTER formula, the number of names that appears is ever-changing)

What I'd like to do is create a formula that exists in a single cell, which will look up each name that appears in column T against column A and then return with the respective email address from column F.

Additionally, it each email address could be separated with a semicolon, that would be great too.

Ultimately, I need this to populate the To: field for an email macro I made

I've tried different variations of VLookup, Index/Match, but not getting what I'd like. thinking of adding a column next to column T, but I'm hoping to get this done without having to add the extra column and without having to distory the data in column F by adding a semi-colon at the end of each address in there.

Tried searching different answers for a macro or formula to accomplish this, but not having much luck putting anything together on my own.

Would really appreciate any help. Please let me know if you need further clarifications

A F T
John Smith JohnSmith@email.com Frank Sinatra
Kimberly Jones Kimberly@email.com Corey Smith
Joe Montana JoeMontana@email.com Kimberly Jones
Dean Martin DeanMartin@email.com John Smith
Corey Smith Corey.Smith@email.com
Frank Sinatra Frank.Sinatra@email.com

And then in the cell Z1, where the formula will be, it will produce the below:

Frank.Sinatra@email.com; Corey.Smith@email.com; Kimberly@email.com; JohnSmith@email.com      
Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
maestro
  • 17
  • 7

1 Answers1

1

Then try below formula-

=TEXTJOIN("; ",TRUE,XLOOKUP(C1:C4,A1:A6,B1:B6))

enter image description here

Harun24hr
  • 30,391
  • 4
  • 21
  • 36
  • I think this works perfectly. I'll have to come back in about 12 hours to test it out, but I think it's correct...thanks so much Harun. Will get back to you later – maestro Feb 01 '21 at 16:09
  • This is great. Thanks a lot for the help Harun – maestro Feb 02 '21 at 01:44
  • Hi Harun, do you know of another formula that can be used to accomplish this? just realized this needs to work in Excel 2016 – maestro Feb 10 '21 at 01:36
  • `Excel2016` do not have `TEXTJOIN()` formula. Then you need custom UDF of Textjoin. See this post. [TextJoin UDF For Excel 2013](https://stackoverflow.com/questions/45843881/textjoin-udf-for-excel-2013) – Harun24hr Feb 10 '21 at 01:53
  • thanks again Harun. yeah i saw a few posts that said UDF was the only option. i'm going to have to post another question for this - too complicated for me – maestro Feb 10 '21 at 04:12