Return elements in list A if duplicates found in list B

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
207
Office Version
  1. 2021
Platform
  1. Windows
Hello,

I need a formula that returns an array of matching elements of list A, IF duplicates of it's values are found in list B.

LIST A (source list)LIST B (list to check against)
hellowell
therehello
myare
partneryou
my
partner
today

So I'm looking for a formula that will return an array that contains {hello,my,partner}.

Note: Output must maintain the list order (e.g. so {my,hello,partner} or {partner,my,hello} are incorrect). And the formula must return an array (as I need to run additional calculations on it in a cell).

Can anyone assist?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Would either of these suffice?

Book1
AB
1LIST A (source list)LIST B (list to check against)
2hellowell
3therehello
4myare
5partneryou
6my
7partner
8today
9
10Array match 1Array match 2
11hellohello,my,partner
12my
13partner
Sheet2
Cell Formulas
RangeFormula
A11:A13A11=FILTER(A2:A8,ISNUMBER(XMATCH(A2:A8,B2:B8,0,1)))
B11B11=TEXTJOIN(",",TRUE,FILTER(A2:A8,ISNUMBER(XMATCH(A2:A8,B2:B8,0,1))))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,225,757
Messages
6,186,848
Members
453,379
Latest member
gabriellegonzalez

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