Using Xmatch to look at multiple columns to extract list?

Coyotex3

Well-known Member
Joined
Dec 12, 2021
Messages
507
Office Version
  1. 365
Platform
  1. Windows
Hey all, so in theory this seems doable, but I can't figure out. I have a range with some data from which I'd like to compare two columns in a range to two separate columns in another range and extract result based on the matches. I'm able to use a combination of Filter, ISNUMBER, and Xmatch to extract results when only looking at 1 column but can't do it with 2.


I'm looking at a range of data similar to this one:

Book1
ABC
1NameCityAmount
2JohnNYC100
3PayneMA200
4AustinUT300
5JohnNC400
6PayneNJ400
7BrandonCA200
8TyCO500
9BrandonNE100
10JohnWA100
11AutinID500
Sheet1


I'd like to compare that range to this list:

Book1
JK
1NameCity
2JohnNYC
3PayneMA
4AustinUT
5BrandonCA
6TyCO
7JohnWA
8AutinID
Sheet1


To get these results:
Book1
FGH
1NameCityAmount
2JohnNYC100
3PayneMA200
4AustinUT300
5BrandonCA200
6TyCO500
7JohnWA100
8AutinID500
Sheet1


Can this be accomplished with a single cell formula?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about:

Excel Formula:
=XLOOKUP(J2:J8&K2:K8,A2:A11&B2:B11,C2:C11)
 
Upvote 0
Solution
Hey! Thanks for the response, This Xlookup formula might work. Just have to test it out on the actual data set.

Curious to know if Xmatch could also handle something like this.
 
Upvote 0
XMATCH alone doesn't return the value, only the index. You'd need to use it with something like INDEX.
Book2
ABCDEFG
1NameCityAmountNameCityAmount
2JohnNYC100JohnNYC100
3PayneMA200PayneMA200
4AustinUT300AustinUT300
5JohnNC400BrandonCA200
6PayneNJ400TyCO500
7BrandonCA200JohnWA100
8TyCO500AutinID500
9BrandonNE100
10JohnWA100
11AutinID500
Sheet2
Cell Formulas
RangeFormula
G2:G8G2=INDEX(C2:C11,XMATCH(E2:E8&"|"&F2:F8,A2:A11&"|"&B2:B11))
Dynamic array formulas.
 
Upvote 0
Another option:

Excel Formula:
=INDEX(C2:C11,MAP(F2:F8,G2:G8,LAMBDA(a,b,XMATCH(1,(a=A2:A11)*(b=B2:B11)))),0)
 
Upvote 0
Thank you both for the options given to me!

I ended up going the Xlookup route as this formula will be housed in a shared file and it will be easier for most users to understand & Troubleshoot.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,126
Members
453,021
Latest member
Justyna P

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