calculating the unique combinations

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
hi,
i've 3 ranges of numbers,
some overlapping with others,
i want to know how many combinations of 6 i have from all, but unique, with no doubles
so i did this, see example
(took the common between any two ranges and subtract from the sum of all)
but when i'm actually generate all and merge the unique the result is different
in the example below the true result is 392 but i got 385
(and the larger the ranges i'm testing the larger the space between true result and what i got)
where am i wrong?


test.xlsb
IJKLMNOPQRSTU
21234567810
3234567891011
43456789101115
5
6
7
8
9
10
11
12
13
14
15984
1610210
1710210
18
19828
20984
2177
22
23385
6
Cell Formulas
RangeFormula
I15I15=COUNTA(J2:R2)
J15:J17,J19:J21J15=COMBIN(I15,6)
I16I16=COUNTA(K3:T3)
I17I17=COUNTA(L4:U4)
I19I19=COUNTA(FILTER(J2:R2,COUNTIF(K3:T3,J2:R2)))
I20I20=COUNTA(FILTER(L4:U4,COUNTIF(K3:T3,L4:U4)))
I21I21=COUNTA(FILTER(L4:U4,COUNTIF(J2:R2,L4:U4)))
J23J23=SUM(J15:J17)-SUM(J19:J21)
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi

If I understand correctly you want the cardinal number of the union of 3 sets.
In this case, you are missing the cardinal of the intersection of the 3 sets.

n(A ∪ B ∪ C) = n(A) + n(B) + n(C) – n(A ∩ B) – n(A ∩ C) – n(B ∩ C) + n(A ∩ B ∩ C)

You are missing the last term

The numbers that are common to all 3 sets are

3, 4, 5, 6, 7, 8, 10

and so you must add

COMBIN(7, 6) = 7

Please test
 
Upvote 0
Solution

Forum statistics

Threads
1,215,523
Messages
6,125,320
Members
449,218
Latest member
Excel Master

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