Formula for combining numbers from 2 tables

bansche123

New Member
Joined
Dec 9, 2019
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Dear Forum Users,

In the uploaded Mini sheet there is a table titled: “ALL possible combinations of NUMBERS”(AZ13:BE22). In this table I would like for combinations of NUMBERS to appear after the comparison of the two SET combinations. This means that in the number combinations there shall be numbers from:

  • “Identical numbers with 2nd combination plus green (Tab. 1)” (BA6:BE11) and
  • “Identical numbers with 1st combination plus green (Tab. 2)” (BA27:BE32)
This is a graphic demonstration how the formula should make the combinations of numbers:
graphic demo.jpg

Basically a number from each SET, must be in the NUMBER combination. Also, maximally, only, one number from each set must be used. In this example I used yellow background to show that in each set of both SET combinations there is a number the forms the NUMBER combination: 1, 11, 24, 30, 31. Now, instead of 24, I could have also picked 8 and 45 and crossed out 24. Then the combination would consist of 6 numbers: 1, 8, 11, 30, 31, 45.

all possible combinations.xlsx
AZBABBBCBDBE
3Identical numbers with 2nd combination plus
4
5green (Tab. 1)
61 24 45 
72  31  
8511    
99  15 30
10121    
1115     
12
13ALL possible combinations of NUMBERS
14
15IIIIIIIVVVI
16111243031
171811303145
18
19
20
21
22
23
24Identical numbers with 1st combination plus
25
26green (Tab. 2)
2718 24  
283 31   
294   30 
3071    
3110 11   
3215     
combining numbers
Cell Formulas
RangeFormula
AZ6:AZ11,AZ27:AZ32AZ6=AS6
BA6:BE10BA6=IF(COUNTIFS($O$27:$S$40,INDEX(O$6:O$19,$AZ6)),IFERROR(1/(1/SUMPRODUCT($O$27:$S$40,ISNUMBER(MATCH($N$27:$N$40,$AZ$27:$AZ$31,))*($O$27:$S$40=INDEX(O$6:O$19,$AZ6)))),""),INDEX(O$6:O$19,$AZ6))
BA11BA11=IF(OR(AT11=AT32,AT11=AT27:AX32),AT11,"")
BB11BB11=IF(OR(AU11=AU32,AU11=AT27:AX32),AU11,"")
BC11BC11=IF(OR(AV11=AV32,AV11=AT27:AX32),AV11,"")
BD11BD11=IF(OR(AW11=AW32,AW11=AT27:AX32),AW11,"")
BE11BE11=IF(OR(AX11=AX32,AX11=AT27:AX32),AX11,"")
BA27:BE31BA27=IF(COUNTIFS($O$6:$S$19,INDEX(O$27:O$40,$AZ27)),IFERROR(1/(1/SUMPRODUCT($O$6:$S$19,ISNUMBER(MATCH($N$27:$N$40,$AZ$6:$AZ$10,))*($O$6:$S$19=INDEX(O$27:O$40,$AZ27)))),""),INDEX(O$27:O$40,$AZ27))
BA32BA32=IF(OR(AT32=AT11,AT32=AT6:AX11),AT32,"")
BB32BB32=IF(OR(AU32=AU11,AU32=AT6:AX11),AU32,"")
BC32BC32=IF(OR(AV32=AV11,AV32=AT6:AX11),AV32,"")
BD32BD32=IF(OR(AW32=AW11,AW32=AT6:AX11),AW32,"")
BE32BE32=IF(OR(AX32=AX11,AX32=AT6:AX11),AX32,"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AZ27:AZ32Cell Value<15textNO
AZ6:AZ11Cell Value<15textNO
AZ27:AZ32Cell Value=15textNO
AZ6:AZ11Cell Value=15textNO


Any help would be appreciated :)
Please don’t hesitate do ask questions of something isn’t quite understandable.
 

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.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Please supply all relevant link(s)

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
UPDATE: I have a newer Excel version – the 365 one, not the 2016 anymore.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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