For a sample table like

+---+---------+--------+------+-----+--+---------+-------+------+-------+
|   |    A    |   B    |  C   |  D  |E |    F    |   G   |  H   |   I   |
+---+---------+--------+------+-----+--+---------+-------+------+-------+
| 1 | Invoice | Brand  | Size | Qty |  | Invoice | Brand | Size | Total |
| 2 | 31      | Coke   | 200  | 1   |  | 31      | Coke  | 200  | 3     |
| 3 | 31      | Coke   | 200  | 2   |  |         |       |      |       |
| 4 | 31      | Sprite | 300  | 4   |  |         |       |      |       |
| 5 | 31      | Fanta  | 100  | 3   |  |         |       |      |       |
| 6 | 31      | Coke   | 300  | 2   |  |         |       |      |       |
+---+---------+--------+------+-----+--+---------+-------+------+-------+


you would use in cell I2

=SUMPRODUCT(($D$2:$D$6)*(F2=$A$2:$A$6)*(G2=$B$2:$B$6)*(H2=$C$2:$C$6))


Hopefully this solves (at least part of) your problem.
This provides one of the many outputs of a PivotTable. Pros: the result is automatically updated (a PivotTable is not). Cons: one may not wish an automatic update (either to keep previous results, or for performance issues with large data sets).

How to use multiple VLOOKUP with duplicate data?
I want to calculate the probability distribution for the total of a combination of dice. 

I remember that the probability of is the number of combinations that total that number over the total number of combinations (assuming the dice have a uniform distribution). 

What are the formulas for


The number of combinations total
The number of combinations that total a certain number

