Oct 11 2020 07:29 PM
Hi, Question:
I have a data set which using XLOOKUP returns an email address for a customer number.
ON the email data set, there are multiple emails for each customer number.
How can I return the next email address using XLOOKUP if there are blanks in this email set?
Any clues?!
Oct 12 2020 09:35 AM
SolutionOct 12 2020 03:26 PM
Oct 13 2020 02:59 AM
@aussieC , you are welcome
Nov 06 2020 03:00 PM
@Sergei Baklan thank you so much. I have learned something new with this, brilliant!
Nov 07 2020 03:22 AM
Each of us learns something new on this resource, I'm not an exception. Anyway, glad to know it helped you, thanks for sharing.
Nov 07 2020 08:01 AM
A couple of thoughts. An alternative to searching for concatenated conditions is to simply strike out the customers that do not have declared email from consideration. If there isn't an entry with an email, you could always relent and use the 'if not found' parameter to repeat the search to return such data that may exist.
= XLOOKUP( @selected, IF(email<>"", customer), email:phone )
or
= XLOOKUP( @selected, IF(email<>"", customer), email:phone,
XLOOKUP( @selected, customer, email:phone ) )
Nov 08 2020 05:38 PM
Thanks @Peter Bartholomew - very helpful! Cheers
Apr 24 2021 12:23 PM
Thanks Sergei this has worked great for me also!
On the xlookup what does the &1 mean also &-- In the formula?
Cheers
Rich
Apr 24 2021 12:45 PM
Rich, glad to help.
Here (C2:C7<>"") returns an array with TRUE or FALSE. Double dash converts them to 1 or 0 accordingly, thus --(C2:C7<>"") returns an array with 1 for non-empty cells and 0 for empty ones.
By & we concatenate B2:B7 with this array (for example ="a" & "b" returns "ab"). Resulting array will be {"f11", "f2", "f21", "f3",...}.
=D3&1 returns text "f21". Finally we try to find this text in above array and return related value from C2:C7.
Oct 12 2020 09:35 AM
Solution