I need to get the sum of the prices when the contract is ZS but need the sum per quantity of 10. So in this example, i need to find the sum of first 4 columns because that will make the quantity add up to 10. The problem is, i copy and paste in sets of data where the "ZS" contract will fill at a different number of prices that cause it to add up to a quantity of 10. in the end I am trying to make a calculator to calculate agricultural crush. I have been stuck on this for days, Please Help!
<tbody>
</tbody>
FIllID | CONTRACT | Price | BuySell | OrderType | Quantity |
1 | ZS | 10914 | Buy | LMT | 1 |
2 | ZS | 10926 | Buy | LMT | 1 |
3 | ZS | 10932 | Buy | LMT | 1 |
4 | ZS | 10944 | Buy | LMT | 7 |
5 | ZL | 3186 | Sell | LMT | 9 |
6 | ZM | 3982 | Sell | LMT | 11 |
7 | ZS | 10946 | Buy | LMT | 10 |
8 | ZL | 3186 | Sell | LMT | 9 |
9 | ZM | 3982 | Sell | LMT | 11 |
<tbody>
</tbody>