Forum Discussion
jwmartin
Jul 28, 2021Copper Contributor
Auto Fill Emails based on Name Entry
Hello! I'm working on a spreadsheet to distribute documents to clients via email. I have our company email list on one sheet of this workbook, and the list of people to which I'm distributing on ...
NancyBogg
Jul 28, 2021Copper Contributor
A vlookup will do it, but you'll need to change the order of your columns. The value you're looking to match (First Last) needs to be in the first column of your email database. I would also make a column where you combine first and last into a single column on both pages, it will make the lookup statement easier.
your formula will look like: vlookup(firstlast,emaildatabase,2,false)
your formula will look like: vlookup(firstlast,emaildatabase,2,false)
- mtarlerJul 28, 2021Silver Contributor
NancyBogg There are multiple ways you can do this. One way is to use XLOOKUP:
=XLOOKUP(TRIM([@[last_name]])&TRIM([@[first_name]]),TRIM(Table1[LastName])&TRIM(Table1[FirstName]),Table1[Email],"n/a")I had to add the TRIM functions because some of the entries had extra spaces and others didn't.
If you don't have MS365 you could use INDEX( MATCH () ) combo instead:
=INDEX(Table1[Email],MATCH(TRIM([@[last_name]])&TRIM([@[first_name]]),TRIM(Table1[LastName])&TRIM(Table1[FirstName]),0) )