Forum Discussion
XLOOKUP
007Nic XLOOKUP returns only the first match it finds. So, it finds the first "Dale Isaac" and returns whatever it finds in the email column on that row. If that cell is blank the result is 0.
You need to look into FILTER and TEXTJOIN. Then you can get all email addresses for a particular person and join them into one text string. If that's what you want, of course.
EDIT: file with an example attached.
In this scenario there will not be more than one email per person, only blanks. If I can get the email address which ignore all the blank rows it will be great.
- Riny_van_EekelenSep 24, 2022Platinum Contributor
007Nic Did you see the file I attached earlier? Remove the 2nd email address and the formula will still work. But, if you are 100% sure that there will never be more than one email address per person you could shorten the formula by removing the arguments relating to the TEXTJOIN function (bold red below).
=TEXTJOIN(", ",TRUE,FILTER(contacts[emailaddress],(contacts[fullname]=E7)*(contacts[emailaddress]<>""),""))
- 007NicSep 24, 2022Copper Contributor
Hi Riny, thank you this works with the blank cells excluded and only return the email address. I now get the SPILL error since it is a table and want to return multiple same email addresses. This is due to multiple of the same email addresses where the person are linked to multiple accounts within the database. How can I resolve that I only get one email address.
- Riny_van_EekelenSep 24, 2022Platinum Contributor
007Nic Then you need to introduce UNIQUE also. See attached.