Similar to James006's idea of a lookup table, you can use CHOOSE with a truth table. Consider:
Book1 |
---|
|
---|
| A | B | C | D | E | F |
---|
1 | | | | | | |
---|
2 | | Match | Kill Order=1 | Truck #=1 | Value | |
---|
3 | Case 1 | N | N | N | 0 | ISNUMBER(MATCH(A3,Z1:Z10,0))*4+(KO3=1)*2+(TN3=1) |
---|
4 | Case 2 | N | N | Y | 1 | |
---|
5 | Case 3 | N | Y | N | 2 | |
---|
6 | Case 4 | N | Y | Y | 3 | |
---|
7 | Case 5 | Y | N | N | 4 | |
---|
8 | Case 6 | Y | N | Y | 5 | |
---|
9 | Case 7 | Y | Y | N | 6 | |
---|
10 | Case 8 | Y | Y | Y | 7 | |
---|
11 | | | | | | |
---|
12 | | *4 | *2 | *1 | | CHOOSE(Value+1,"Case 1","Case 2","Case 3","Case 4","Case 5","Case 6","Case 7","Case 8") |
---|
|
---|
The table in A3:D10 is called a truth table, and it has every combination of your three conditions. Now if you consider N=0 and Y=1, and multiply each column by the value in B12:D12, you get the list of values in E3:E10. You can see they are all unique. This is binary counting. The way to convert your three conditions to that value might be something like the formula fragment in F3. I didn't quite see how your posts explained where your values are that you are testing. Once you get the value, you can use a CHOOSE like in F12. Change the "Case 1", etc. to whatever you want to do in that situation. It might actually be better to add another column to the table with the value you want returned. That way you can change the table and not have to change the formulas.