Hi Jmacmd,
I'm not sure I understand the question but here's and example of exclusions for combinations.
I assume you know how to create an ms-query so this is an abbreviated step by step, if you are not familiar with ms-query on self excel file you can read this great in depth step by step explanation
Use MS Query to Treat Excel as a Relational Data Source
Abbreviated step by step:
1. define named ranges, these must start with a header name
2. each named range should consist of only one column and you must define as many as you need for your combination for example: [TABLE="class: grid, width: 216"]
<tbody>[TR]
[TD="align: center"]char1[/TD]
[TD="align: center"]char2[/TD]
[TD="align: center"]char3[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]
1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]
3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]
5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"]
7[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
3. run an ms-query and point-it at your own file, you will see it will come up with the 3 named ranges as if they were tables4. execute the query and this will produce:[TABLE="class: grid, width: 216"]
<tbody>[TR]
[TD="align: center"]char1[/TD]
[TD="align: center"]char2[/TD]
[TD="align: center"]char3[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
</tbody>[/TABLE]
5. if you wish to have exclusions you may try editing the query, the original would look like this:
SELECT char1.char1, char2.char2, char3.char3
FROM char1 char1, char2 char2, char3 char3
and say you want AA only to combine with WX, then add the following to the query:
WHERE (char1='AA' and char3='WX') or char1<>'AA'
as you can see for combinations with AA we only have WX and no WY's:[TABLE="class: grid, width: 216"]
<tbody>[TR]
[TD="align: center"]char1[/TD]
[TD="align: center"]char2[/TD]
[TD="align: center"]char3[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
</tbody>[/TABLE]
6. you can have additional exclusions to the where statements using AND, for example:
WHERE ((char1='AA' AND char3='WX') OR char1<>'AA') AND ((char1='AC' AND char2=3) OR char1<>'AC')
this will produce:[TABLE="class: grid, width: 216"]
<tbody>[TR]
[TD="align: center"]char1[/TD]
[TD="align: center"]char2[/TD]
[TD="align: center"]char3[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AC[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]WY[/TD]
[/TR]
[TR]
[TD="align: center"]AA[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WX[/TD]
[/TR]
[TR]
[TD="align: center"]AB[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]WY[/TD]
[/TR]
</tbody>[/TABLE]
Hope I've responded to you question, sorry for the delayed response.
Angel
Hey angelEG,I was wondering how you removed the duplicates. I can't seem to figure it out. Thanks.