I couldn't think of a clear way to title this post I'm afraid!

In this example there are several different products for sale and we record the number of each that are sold. Each product has a commission payment and the sales person receives commission for all sales EXCEPT 4 sales of the lowest ranked items.

The items are ranked with the lowest on the left. So to do this manually we start with the leftmost item and count the sales until we reach 4 sales. Then from the 5th sale onwards we multipy the sales by the commission figures and add the results up to arrive at the final commission figure.

I've given this a lot of thought and can't think of any way to achieve it without VBA. Unfortunately my Excel VBA skills are not up to the job!

I've be very grateful for any solutions or pointers thanks in advance.