Compare multiple columns and list common values in separate column

Preacherman771

New Member
Joined
Jun 15, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I have a table which contains the weekly opponent for the header team. (BU34:BX51). I want to in column BY34:BY51 list all of the common teams.

Cell Formulas
RangeFormula
BU32BU32=IF(W32="@",X32&"@",IFERROR(INDEX(X32:X35,SMALL(IF(X32:X35<>"",ROW(X32:X35)-ROW(INDEX(X32:X35,1,1))+1),1)),""))
BV32BV32=IF(W33="@",X33&"@",IFERROR(INDEX(X32:X35,SMALL(IF(X32:X35<>"",ROW(X32:X35)-ROW(INDEX(X32:X35,1,1))+1),2)),""))
BW32BW32=IF(W34="@",X34&"@",IFERROR(INDEX(X32:X35,SMALL(IF(X32:X35<>"",ROW(X32:X35)-ROW(INDEX(X32:X35,1,1))+1),3)),""))
BX32BX32=IF(W35="@",X35&"@",IFERROR(INDEX(X32:X35,SMALL(IF(X32:X35<>"",ROW(X32:X35)-ROW(INDEX(X32:X35,1,1))+1),4)),""))
BT34BT34=Data!CU$6
BU34:BX34BU34=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT34=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT34=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT34=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT34=SchedData[Wk'#]),0))),"")))
BT35BT35=Data!CU$7
BU35:BX35BU35=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT35=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT35=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT35=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT35=SchedData[Wk'#]),0))),"")))
BT36BT36=Data!CU$8
BU36:BX36BU36=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT36=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT36=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT36=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT36=SchedData[Wk'#]),0))),"")))
BT37BT37=Data!CU$9
BU37:BX37BU37=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT37=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT37=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT37=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT37=SchedData[Wk'#]),0))),"")))
BT38BT38=Data!CU$10
BU38:BX38BU38=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT38=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT38=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT38=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT38=SchedData[Wk'#]),0))),"")))
BT39BT39=Data!CU$11
BU39:BX39BU39=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT39=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT39=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT39=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT39=SchedData[Wk'#]),0))),"")))
BT40BT40=Data!CU$12
BU40:BX40BU40=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT40=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT40=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT40=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT40=SchedData[Wk'#]),0))),"")))
BT41BT41=Data!CU$13
BU41:BX41BU41=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT41=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT41=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT41=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT41=SchedData[Wk'#]),0))),"")))
BT42BT42=Data!CU$14
BU42:BX42BU42=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT42=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT42=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT42=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT42=SchedData[Wk'#]),0))),"")))
BT43BT43=Data!CU$15
BU43:BX43BU43=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT43=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT43=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT43=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT43=SchedData[Wk'#]),0))),"")))
BT44BT44=Data!CU$16
BU44:BX44BU44=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT44=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT44=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT44=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT44=SchedData[Wk'#]),0))),"")))
BT45BT45=Data!CU$17
BU45:BX45BU45=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT45=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT45=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT45=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT45=SchedData[Wk'#]),0))),"")))
BT46BT46=Data!CU$18
BU46:BX46BU46=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT46=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT46=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT46=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT46=SchedData[Wk'#]),0))),"")))
BT47BT47=Data!CU$19
BU47:BX47BU47=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT47=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT47=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT47=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT47=SchedData[Wk'#]),0))),"")))
BT48BT48=Data!CU$20
BU48:BX48BU48=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT48=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT48=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT48=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT48=SchedData[Wk'#]),0))),"")))
BT49BT49=Data!CU$21
BU49:BX49BU49=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT49=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT49=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT49=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT49=SchedData[Wk'#]),0))),"")))
BT50BT50=Data!CU$22
BU50:BX50BU50=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT50=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT50=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT50=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT50=SchedData[Wk'#]),0))),"")))
BT51BT51=Data!CU$23
BU51:BX51BU51=IF(BU32="","", IF(RIGHT(BU32,1)<>"@",IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(BU32=SchedData[Away])*($BT51=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(BU32=SchedData[Home])*($BT51=SchedData[Wk'#]),0))),""), IFERROR(IFERROR(INDEX(SchedData[Home],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Away])*($BT51=SchedData[Wk'#]),0)),INDEX(SchedData[Away],MATCH(1,(TEXTBEFORE(BU32,"@")=SchedData[Home])*($BT51=SchedData[Wk'#]),0))),"")))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
BTW, if you wouldn't mind taking the time, I wouldn't mind learning the principle behind the final formula for my own growth in excel.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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