Hi All

Slab 0-25 25-50 50-100 >101
Incentive 10 20 30 40

I have above slab and incentive Structure.

I have different person who will sell different quantities.
Supposingly if i have one person whos sold 120, the following steps i follow to arrive at incentive.

First 25 units, 25*10$
25-50 units, 25*20$
50-100 units , 50*30$
>100, 19*40

Total Result 3010
How to formulate this.
Any help will be greatly appreciated.

Thanks