XLOOKUP - but find all matches ...

adambc

Active Member
Joined
Jan 13, 2020
Messages
412
Office Version
  1. 365
Platform
  1. Windows
I have an XLOOKUP that reads like this ...

=IFERROR(XLOOKUP(B1 & B2,'SharePointpathname/[WBname.xlsx]Sheet1'!$J:$J & 'SharePointpathname/[WBname.xlsx]Sheet1'!$K:$K,'SharePointpathname/[WBname.xlsx]Sheet1''!$A:$A),"")

... where B1 (Firstname) & B2 (Surname) are entered via two dialogue boxes

... and Firstname is in 'SharePointpathname/[WBname.xlsx]Sheet1'!$J:$J) & Surname is in ('SharePointpathname/[WBname.xlsx]Sheet1'!$K:$K)

... and 'SharePointpathname/[WBname.xlsx]Sheet1'!$A:$A = ID Number which is what I want

But I may have multiple matches so can't use XLOOKUP?

Is there an alternative that will return ALL matches?

And all the better if it's a VBA solution rather than an Excel function

Thanks ...
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Is there an alternative that will return ALL matches?
Have a look at using the Filter function

 
Upvote 0
Hi,

I guess you can use FILTER() instead like this :
Excel Formula:
=IFERROR(FILTER($A:$A,($J:$J=B1)*($K:$K=B2)),"")

(adding your sharepoint details before it as you have above..)
 
Upvote 0
Hi,

I guess you can use FILTER() instead like this :
Excel Formula:
=IFERROR(FILTER($A:$A,($J:$J=B1)*($K:$K=B2)),"")

(adding your sharepoint details before it as you have above..)
What is the IFERROR formula needed for?
The FILTER function already has an argument of what to return if there is no match (3rd argument), i.e.
Excel Formula:
=FILTER($A:$A,($J:$J=B1)*($K:$K=B2),"")
 
Upvote 0
Solution
evidently nothing Joe :) good spot.
I must admit, the main reason I know that is because I did the same thing when I first starting using the function (and was unaware of that third argument too!).
 
Upvote 0
well, I can't say I didn't know.. but was more just paying too much attention to the OP's use of the Xlookup ...
 
Upvote 0
What is the IFERROR formula needed for?
The FILTER function already has an argument of what to return if there is no match (3rd argument), i.e.
Excel Formula:
=FILTER($A:$A,($J:$J=B1)*($K:$K=B2),"")
Perfect, thanks to all for your help ...
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top