Excel – Copy DUPLICATE values from two columns into a third column

microsoft excelworksheet-function

This is similar to another post:

Copy unique values from two columns into a third column

I am looking to do the Opposite of this: Here's the gist…

Two separate things I am looking for from 5 ranges of data.

#1 involves two ranges: W17:W49, G17:G49 (in the attached image, this is MRC/GAP Member, and Life & Disability Member):
If a number appears in both ranges, the duplicate number should print in a 3rd column. (in the attached image, range L4:M11)

#2 involves five ranges: W17:W49, U17:U49, G17:G49, C17:C49, E17:E49 :
If a number appears in Range W AND either Range C or Range E
OR a number appears in Range U AND Range G
the duplicate Number should print in a 3rd column (in the attached image, range N4:O11)

(in the attached image, these columns are MRC/GAP Member, MRC Member, Life & Disability Member, Life Member, Disability Member)

FileView

Best Answer

Here is a similar example that you can adap to your needs. The two lists are in column A from A1 through A15 and column B.

In C1 enter:

=IFERROR(INDEX($A$1:$A$15,AGGREGATE(15,6,ROW($1:$999)/(ISNUMBER(MATCH($A$1:$A$15,B:B,0))),ROW(1:1))),"")

and copy downwards:

enter image description here

Related Question