Formula for tiered commission on different quantity/price levels

Mak1

New Member
Joined
Mar 18, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi hope this makes sense.....

I need to work out commission on (1) quantity of product and (2) its sale price.

I would appreciate some suggestions and help on the 2 points below:

  • The commission is 50% for any sales of products equal to or above £5 value and decreases by 0.1% for every penny less than £5.
    The formula I have for this so far :
    =((0.5-(5-C19)*0.1)*C19) where C19 is the sales price.

    Can this be simplified or tidied up? Also how do I include it allow a sales price over £5 to stick at 50% commission?

  • The above formula is for the first 5000 units. Thereafter every 1000 units sold the commission amount (result of formula from point above) is decreased/discounted by 1%.

    What would the formula be, if the number of units sold is E19 and I wanted to show the total commission in F19?

    For e.g.
    A) If 7000 units were sold at £6.00, commission would be as follows:
    1) 50% for the first 5000 units ( £3 x 5000 ) = £3000
    2) (50% for the units 5001 to 6000 ; £3 x 1000) with a 1% discount = £2970
    3) (50% for the units 6001 to 7000 ; £3 x 1000) with a 2% discount = £2940

    TOTAL £8910

    B) If 7000 units were sold at £0.60, commission would be as follows:
    1) 6% for the first 5000 units ( £0.036 x 5000 ) = £180
    2) (6% for the units 5001 to 6000 ; £0.036 x 1000) with a 1% discount = £35.64
    3) (6% for the units 6001 to 7000 ; £0.036 x 1000) with a 2% discount = £35.28

    TOTAL £250.92


    Should you have any questions please let me know.
 
What are the brackets and rates if you base the calculations on the value of the of the sales?

With that information, what are your expected results?

Hi Dave,
"What are the brackets and rates if you base the calculations on the value of the of the sales?"

The calculation is based on two variables:

1) sales price:
Payout = 50% for any sales of products equal to or above £5 value and decreases by 0.1% for every penny less than £5.

2) amount:
The above payout (in point 1) is for the first 5000 units. Thereafter every 1000 units sold the payout is decreased/discounted by 1%
.

"With that information, what are your expected results?"

One line breakdown with automated calculations, when the two variables above are the only inputs required. i.e. a sale of x units at £y per unit. I assume this will have to refer to a previous sheet with the tier breakdowns.


Using two examples; first a sale of 7001 units at £6.00, and secondly a sale of 7001 units at £0.60:

The table below is sorted as below:

Columns A to E : Kirk's route
Columns G to N: My route ( worked out from internet research )
Columns Q to S: Dave's route

Rows 1 to 23: 3 x routes' above calculations for payout amount based on the two sales examples

Rows 25 to 30 show a one line simplification. This section is a crude layout of what I expect to be able to populate when I need to input a sale of x units at £y per unit. So for example usiny my route:

Ideally the formula in K29 : "=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6) " should somehow reference that the "$K$3:$K$6" range is variable depending on J29. Is there any we could populate I29 and J29 (this layout would be on Sheet2) to use as variables in N4,N3, which subsequently changes K3:K6 and calculates the amount in N5 (this layout would be on Sheet1) and result of N5 bought forward into K29? My experience with Excel is very basic and not sure if MATCH, LOOKUP, SUMPRODUCT or VBA route will be the best thing to use here, but having a worksheet breakdown of each product line is not desired, just one excel file with minimum sheets, whereby I can list 1 product line or 30 product lines based on 2 inputs (amounts and sales price) per line, and the commission due is calculated.


20.03.22 trial commission sheet.xlsx
ABCDEFGHIJKLMNOPQRSTU
1KIRK's £6 RouteMy £6 RouteDave's £6 Route
2Units SoldSales PriceTiersCommissionTier MinTier MaxPayoutDif RateAmount700120913.21
370016500015000-5,000£ 3.003.0000000000Sales Price£ 6.00
41000297015,0016,000£ 2.970(0.0300000000)Amount7001BracketsPayout
51000294026,0017,000£ 2.940(0.0300000000)Payout£ 20,913.00
612.9137,0018,000£ 2.910(0.0300000000)03
7  50002.97
8  60002.9403
9  70002.9109
1080002.88179
1190002.85297
12
13KIRK's £0.60 RouteMy £0.60 RouteDave's £0.60 Route
14Units SoldSales PriceTiersCommission / PayoutTier MinTier MaxPayoutDif RateAmount7001250.96
1570010.65000180-5,000£ 0.036000.0360000000Sales Price£ 0.60
16100035.6415,0016,000£ 0.03564(0.0003600000)Amount7001.00BracketsPayout
17100035.2826,0017,000£ 0.03528(0.0003600000)Payout£ 250.96
1810.0349237,0018,000£ 0.03492(0.0003600000)00.036
19  50000.03564
20  60000.03528
21  70000.03493
2280000.03458
2390000.03424
24
25 Kirk's Example simplified into one line per transaction My Example simplified into one line per transactionDave's simplified into one line per transaction
26
27ProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier Revenue
28
2917001£ 6.0020912.91£ 21,093.0917001£ 6.0020913.00£ 21,093.0017001£ 6.0020913.21£ 21,092.79
3027001£ 0.60250.95£ 3,949.6527001£ 0.60250.96£ 3,949.6427001£ 0.60250.96£ 3,949.64
Sheet1
Cell Formulas
RangeFormula
S2,S14S2=SUMPRODUCT(--(R2>Q6:Q11),R2-Q6:Q11,R6:R11-R5:R10)
D3D3=MIN(5000,$B$3)
E3,E15E3=((0.5-MAX(0,0.001*100*(5-C3)))*C3)*D3
D4:D9D4=IF(SUM(D$3:D3)=$B$3,"",MIN(1000,$B$3-SUM(D$3:D3)))
E4:E9,E19:E21E4=IF(ISNUMBER(D4),$E$3/$D$3*D4*(1-ROWS(E$3:E3)/100),"")
J3J3=IF($N$3>5,$N$3*0.5,((0.5-(5-$N$3)*0.1)*$N$3))
K3,K15K3=J3
J4:J6J4=$J$3*((100-G4)*0.01)
K4:K6,K16:K18K4=J4-J3
N5N5=SUMPRODUCT(--(N4>$H$3:$H$6),--(N4-$H$3:$H$6),$K$3:$K$6)
R7:R11,R19:R23R7=R6*0.99
D15D15=MIN(5000,$B$15)
D16:D21D16=IF(SUM(D$15:D15)=$B$15,"",MIN(1000,$B$15-SUM(D$15:D15)))
E16:E18E16=IF(ISNUMBER(D16),$E$15/$D$15*D16*(1-ROWS(E$15:E15)/100),"")
J15J15=IF($N$15>5,$N$15*0.5,((0.5-(5-$N$15)*0.1)*$N$15))
J16:J18J16=$J$15*((100-G16)*0.01)
N17N17=SUMPRODUCT(--(N16>$H$15:$H$18),--(N16-$H$15:$H$18),$K$15:$K$18)
D29D29=SUMPRODUCT(E3:E6)
E29:E30,U29:U30,L29:L30E29=(C29*B29)-D29
D30D30=SUMPRODUCT(E15:E18)
K29K29=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6)
K30K30=SUMPRODUCT(--(I30>$H$15:$H$18),--(I30-$H$15:$H$18),$K$15:$K$18)
T29T29=SUMPRODUCT(--(R29>Q6:Q11),R29-Q6:Q11,R6:R11-R5:R10)
T30T30=SUMPRODUCT(--(R30>Q18:Q23),R30-Q18:Q23,R18:R23-R17:R22)



I've just noticed your recent reply, and as I input 7001 units at £0.60 the payout is off and I think this is not taking into account the decreases by 0.1% for every penny less than £5 as per table below:

Book1
ABCDE
1
2
3BracketsPayout
4
500.5
650000.495
760000.49005
870000.48515
980000.480298
1090000.475495
11
12NumberPriceAmount
137001629892.12
1410810.8583.2
154328.641866.24
1670010.62989.212
Sheet1
Cell Formulas
RangeFormula
E6:E10E6=E5*0.99
D13:D16D13=SUM(IF(B13>ab,(B13-ab)*ar))*C13
Named Ranges
NameRefers ToCells
ab=Sheet1!$D$5:$D$10D13:D16
ar=Sheet1!$E$5:$E$10D13:D16, E6
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi Dave,
"What are the brackets and rates if you base the calculations on the value of the of the sales?"

The calculation is based on two variables:

1) sales price:
Payout = 50% for any sales of products equal to or above £5 value and decreases by 0.1% for every penny less than £5.

2) amount:
The above payout (in point 1) is for the first 5000 units. Thereafter every 1000 units sold the payout is decreased/discounted by 1%
.

"With that information, what are your expected results?"

One line breakdown with automated calculations, when the two variables above are the only inputs required. i.e. a sale of x units at £y per unit. I assume this will have to refer to a previous sheet with the tier breakdowns.


Using two examples; first a sale of 7001 units at £6.00, and secondly a sale of 7001 units at £0.60:

The table below is sorted as below:

Columns A to E : Kirk's route
Columns G to N: My route ( worked out from internet research )
Columns Q to S: Dave's route

Rows 1 to 23: 3 x routes' above calculations for payout amount based on the two sales examples

Rows 25 to 30 show a one line simplification. This section is a crude layout of what I expect to be able to populate when I need to input a sale of x units at £y per unit. So for example usiny my route:

Ideally the formula in K29 : "=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6) " should somehow reference that the "$K$3:$K$6" range is variable depending on J29. Is there any we could populate I29 and J29 (this layout would be on Sheet2) to use as variables in N4,N3, which subsequently changes K3:K6 and calculates the amount in N5 (this layout would be on Sheet1) and result of N5 bought forward into K29? My experience with Excel is very basic and not sure if MATCH, LOOKUP, SUMPRODUCT or VBA route will be the best thing to use here, but having a worksheet breakdown of each product line is not desired, just one excel file with minimum sheets, whereby I can list 1 product line or 30 product lines based on 2 inputs (amounts and sales price) per line, and the commission due is calculated.


20.03.22 trial commission sheet.xlsx
ABCDEFGHIJKLMNOPQRSTU
1KIRK's £6 RouteMy £6 RouteDave's £6 Route
2Units SoldSales PriceTiersCommissionTier MinTier MaxPayoutDif RateAmount700120913.21
370016500015000-5,000£ 3.003.0000000000Sales Price£ 6.00
41000297015,0016,000£ 2.970(0.0300000000)Amount7001BracketsPayout
51000294026,0017,000£ 2.940(0.0300000000)Payout£ 20,913.00
612.9137,0018,000£ 2.910(0.0300000000)03
7  50002.97
8  60002.9403
9  70002.9109
1080002.88179
1190002.85297
12
13KIRK's £0.60 RouteMy £0.60 RouteDave's £0.60 Route
14Units SoldSales PriceTiersCommission / PayoutTier MinTier MaxPayoutDif RateAmount7001250.96
1570010.65000180-5,000£ 0.036000.0360000000Sales Price£ 0.60
16100035.6415,0016,000£ 0.03564(0.0003600000)Amount7001.00BracketsPayout
17100035.2826,0017,000£ 0.03528(0.0003600000)Payout£ 250.96
1810.0349237,0018,000£ 0.03492(0.0003600000)00.036
19  50000.03564
20  60000.03528
21  70000.03493
2280000.03458
2390000.03424
24
25 Kirk's Example simplified into one line per transaction My Example simplified into one line per transactionDave's simplified into one line per transaction
26
27ProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier Revenue
28
2917001£ 6.0020912.91£ 21,093.0917001£ 6.0020913.00£ 21,093.0017001£ 6.0020913.21£ 21,092.79
3027001£ 0.60250.95£ 3,949.6527001£ 0.60250.96£ 3,949.6427001£ 0.60250.96£ 3,949.64
Sheet1
Cell Formulas
RangeFormula
S2,S14S2=SUMPRODUCT(--(R2>Q6:Q11),R2-Q6:Q11,R6:R11-R5:R10)
D3D3=MIN(5000,$B$3)
E3,E15E3=((0.5-MAX(0,0.001*100*(5-C3)))*C3)*D3
D4:D9D4=IF(SUM(D$3:D3)=$B$3,"",MIN(1000,$B$3-SUM(D$3:D3)))
E4:E9,E19:E21E4=IF(ISNUMBER(D4),$E$3/$D$3*D4*(1-ROWS(E$3:E3)/100),"")
J3J3=IF($N$3>5,$N$3*0.5,((0.5-(5-$N$3)*0.1)*$N$3))
K3,K15K3=J3
J4:J6J4=$J$3*((100-G4)*0.01)
K4:K6,K16:K18K4=J4-J3
N5N5=SUMPRODUCT(--(N4>$H$3:$H$6),--(N4-$H$3:$H$6),$K$3:$K$6)
R7:R11,R19:R23R7=R6*0.99
D15D15=MIN(5000,$B$15)
D16:D21D16=IF(SUM(D$15:D15)=$B$15,"",MIN(1000,$B$15-SUM(D$15:D15)))
E16:E18E16=IF(ISNUMBER(D16),$E$15/$D$15*D16*(1-ROWS(E$15:E15)/100),"")
J15J15=IF($N$15>5,$N$15*0.5,((0.5-(5-$N$15)*0.1)*$N$15))
J16:J18J16=$J$15*((100-G16)*0.01)
N17N17=SUMPRODUCT(--(N16>$H$15:$H$18),--(N16-$H$15:$H$18),$K$15:$K$18)
D29D29=SUMPRODUCT(E3:E6)
E29:E30,U29:U30,L29:L30E29=(C29*B29)-D29
D30D30=SUMPRODUCT(E15:E18)
K29K29=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6)
K30K30=SUMPRODUCT(--(I30>$H$15:$H$18),--(I30-$H$15:$H$18),$K$15:$K$18)
T29T29=SUMPRODUCT(--(R29>Q6:Q11),R29-Q6:Q11,R6:R11-R5:R10)
T30T30=SUMPRODUCT(--(R30>Q18:Q23),R30-Q18:Q23,R18:R23-R17:R22)



I've just noticed your recent reply, and as I input 7001 units at £0.60 the payout is off and I think this is not taking into account the decreases by 0.1% for every penny less than £5 as per table below:

Book1
ABCDE
1
2
3BracketsPayout
4
500.5
650000.495
760000.49005
870000.48515
980000.480298
1090000.475495
11
12NumberPriceAmount
137001629892.12
1410810.8583.2
154328.641866.24
1670010.62989.212
Sheet1
Cell Formulas
RangeFormula
E6:E10E6=E5*0.99
D13:D16D13=SUM(IF(B13>ab,(B13-ab)*ar))*C13
Named Ranges
NameRefers ToCells
ab=Sheet1!$D$5:$D$10D13:D16
ar=Sheet1!$E$5:$E$10D13:D16, E6

Not sure of this helps but this is the example of the possible layouts (rows 32 to 48) that I could adapt for reference sheet 1, but am looking for a way that does not need a table with references for every single possible price from £0.10 to £5+? Hence my thoughts in previous message "Ideally the formula in K29 : "=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6) " should somehow reference that the "$K$3:$K$6" range is variable depending on J29....."

20.03.22 trial commission sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVW
25 Kirk's Example simplified into one line per transaction My Example simplified into one line per transactionDave's simplified into one line per transaction
26
27ProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier RevenueProductAmount soldSales priceCommission / PayoutSupplier Revenue
28
2917001£ 6.0020912.91£ 21,093.0917001£ 6.0020913.00£ 21,093.0017001£ 6.0020913.21£ 21,092.79
3027001£ 0.60250.95£ 3,949.6527001£ 0.60250.96£ 3,949.6427001£ 0.60250.96£ 3,949.64
31
32REFERENCE SHEET 1 (v1) for looking up and applying price to volume formula?REFERENCE SHEET 1 (v2) ?
33
34*FOREX USED£0.60 rates£6 rates
35GBPEURUSDTier MinTier MaxPayoutDif RatePayoutDif Rate
36£ 1.00€ 1.20$ 1.36-5,000£ 0.036000.0360000000£ 3.003.0000000000
37GBP sales price examples used in tables below, showing consequent EUR and USD conversions at current FOREX rates.15,0016,000£ 0.03564(0.0003600000)£ 2.970(0.0300000000)
3826,0017,000£ 0.03528(0.0003600000)£ 2.940(0.0300000000)
39Sales price per unitSplit%Supplier amount per unitCommission amount per unit37,0018,000£ 0.03492(0.0003600000)£ 2.910(0.0300000000)
40GBPEURUSDSupplierUsGBPEURUSDGBPEURUSD
41
42£ 5.00€ 6.00$ 6.8050.0%50.0%£ 2.50000€ 3.00$ 3.40£ 2.50000£ 3.00000$ 3.40000
43£ 4.95€ 5.94$ 6.7350.5%49.5%£ 2.49975€ 3.00$ 3.40£ 2.45025£ 2.94030$ 3.33234
44£ 4.90€ 5.88$ 6.6651.0%49.0%£ 2.49900€ 3.00$ 3.40£ 2.40100£ 2.88120$ 3.26536
45£ 4.85€ 5.82$ 6.6051.5%48.5%£ 2.49775€ 3.00$ 3.40£ 2.35225£ 2.82270$ 3.19906
46£ 4.80€ 5.76$ 6.5352.0%48.0%£ 2.49600€ 3.00$ 3.39£ 2.30400£ 2.76480$ 3.13344
47£ 4.75€ 5.70$ 6.4652.5%47.5%£ 2.49375€ 2.99$ 3.39£ 2.25625£ 2.70750$ 3.06850
48£ 4.70€ 5.64$ 6.3953.0%47.0%£ 2.49100€ 2.99$ 3.39£ 2.20900£ 2.65080$ 3.00424
Sheet1
Cell Formulas
RangeFormula
D29D29=SUMPRODUCT(E3:E6)
E29:E30,U29:U30,L29:L30E29=(C29*B29)-D29
D30D30=SUMPRODUCT(E15:E18)
K29K29=SUMPRODUCT(--(I29>$H$3:$H$6),--(I29-$H$3:$H$6),$K$3:$K$6)
K30K30=SUMPRODUCT(--(I30>$H$15:$H$18),--(I30-$H$15:$H$18),$K$15:$K$18)
T29T29=SUMPRODUCT(--(R29>Q6:Q11),R29-Q6:Q11,R6:R11-R5:R10)
T30T30=SUMPRODUCT(--(R30>Q18:Q23),R30-Q18:Q23,R18:R23-R17:R22)
T36T36=IF($N$15>5,$N$15*0.5,((0.5-(5-$N$15)*0.1)*$N$15))
U36,W36U36=T36
V36V36=IF($N$3>5,$N$3*0.5,((0.5-(5-$N$3)*0.1)*$N$3))
T37:T39T37=$T$36*((100-Q37)*0.01)
U37:U39,W37:W39U37=T37-T36
V37:V39V37=$V$36*((100-Q37)*0.01)
B42:B48B42=A42*$B$36
C42:C48C42=A42*$C$36
H42:H48H42=A42*E42
I42:I48I42=B42*E42
J42:J48J42=C42*E42
L42:L48L42=A42*F42
M42:M48M42=B42*F42
N42:N48N42=C42*F42
 
Upvote 0
Give this version a test drive. This is a single line formula (no helper tables or lookups needed) that makes use of some of Excel 365's new functions to create two arrays. One array holds the sales quantities in each tier. The other array holds the per unit commission for each tier according to the declining percentage method described. Then SUMPRODUCT operates on those two arrays. Please let me know if you encounter any errors with it.
MrExcel20220319.xlsx
ABCD
1Units SoldSales PriceTotal Commission
27001£6.00£20,912.91
312305£4.00£19,200.96
42500£11.40£14,250.00
51001£6.00£3,003.00
65£3.00£4.50
79500£10.00£46,875.00
87000£0.60£250.92
97000£6.00£20,910.00
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=LET(tiers,1+MAX(0,CEILING($B2-5000,1000))/1000, seq,SEQUENCE(tiers,,1,1), SUMPRODUCT(SEQUENCE(tiers,,1,-0.01)*$C2*(0.5-MAX(0,0.001*100*(5-$C2))), IF(seq=1, MIN(5000,$B2), IF(seq<tiers, 1000, IF(seq=tiers, 1000*(MOD($B2,1000)=0)+$B2-FLOOR($B2,1000) ))) ))
 
Upvote 0
Solution
Give this version a test drive. This is a single line formula (no helper tables or lookups needed) that makes use of some of Excel 365's new functions to create two arrays. One array holds the sales quantities in each tier. The other array holds the per unit commission for each tier according to the declining percentage method described. Then SUMPRODUCT operates on those two arrays. Please let me know if you encounter any errors with it.
MrExcel20220319.xlsx
ABCD
1Units SoldSales PriceTotal Commission
27001£6.00£20,912.91
312305£4.00£19,200.96
42500£11.40£14,250.00
51001£6.00£3,003.00
65£3.00£4.50
79500£10.00£46,875.00
87000£0.60£250.92
97000£6.00£20,910.00
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=LET(tiers,1+MAX(0,CEILING($B2-5000,1000))/1000, seq,SEQUENCE(tiers,,1,1), SUMPRODUCT(SEQUENCE(tiers,,1,-0.01)*$C2*(0.5-MAX(0,0.001*100*(5-$C2))), IF(seq=1, MIN(5000,$B2), IF(seq<tiers, 1000, IF(seq=tiers, 1000*(MOD($B2,1000)=0)+$B2-FLOOR($B2,1000) ))) ))
WOW!

That is brilliant!

Thank you so much kind sir!

I'll give it a good test run and expect to mark this thread as solved :-)
 
Upvote 0
WOW!

That is brilliant!

Thank you so much kind sir!

I'll give it a good test run and expect to mark this thread as solved :)
Big tick and gold star for you Kirk!

This is solved, super smashing great!

Thank you!!!!
 
Upvote 0
Upvote 0
You're welcome...we're happy to help.
Hi Kirk,

I've just spotted that the formula "as is" allows the commission to go into negative if units sold amounts got really high, as per table below and was wondering if there was any we could have a bottom level of commission rate at 0.01% or similar?

Commission Template Final 20.03.22.xlsx
CDE
2Units SoldSales PriceTotal Commission
33000006-409800
4180000678000
5200000626700
Sheet1
Cell Formulas
RangeFormula
E3:E5E3=LET(tiers,1+MAX(0,CEILING($C3-5000,1000))/1000, seq,SEQUENCE(tiers,,1,1), SUMPRODUCT(SEQUENCE(tiers,,1,-0.01)*$D3*(0.5-MAX(0,0.001*100*(5-$D3))), IF(seq=1, MIN(5000,$C3), IF(seq<tiers, 1000, IF(seq=tiers, 1000*(MOD($C3,1000)=0)+$C3-FLOOR($C3,1000) ))) ))
 
Upvote 0
You can name the rate differential information,
Does the following give the results that you require for the 2 rate structures?

Commission2022.xlsm
ABCD
21Units SoldSales PriceTotal Commission
227,001620,913.21
2312,305428,905.64
242,50011.414,250.00
251,00163,003.00
26539.00
279,5001046,882.49
287,0000.62,509.24
297,000620,910.30
3010810.8583.20
314328.641,866.24
321,0004.52,700.00
338640.6311.04
341,0801.81,166.40
35
1ff
Cell Formulas
RangeFormula
D22:D34D22=SUM(IF(B22>aB,(B22-aB)*IF(C22>=5,aR,a6RR)))*C22


Hi Dave,

There seems to be some discrepancy here. The correct amounts for the first 8 lines values you posted are below:

Commission Template Final 20.03.22.xlsx
CDE
2Units SoldSales PriceTotal Commission
37001620912.91
412305419200.96
5250011.414250
6100163003
7534.5
895001046875
970000.6250.92
107000620910
Sheet1
Cell Formulas
RangeFormula
E3:E10E3=LET(tiers,1+MAX(0,CEILING($C3-5000,1000))/1000, seq,SEQUENCE(tiers,,1,1), SUMPRODUCT(SEQUENCE(tiers,,1,-0.01)*$D3*(0.5-MAX(0,0.001*100*(5-$D3))), IF(seq=1, MIN(5000,$C3), IF(seq<tiers, 1000, IF(seq=tiers, 1000*(MOD($C3,1000)=0)+$C3-FLOOR($C3,1000) ))) ))
 
Upvote 0
I see that. The issue is with the rule to decrease the commission rate by 1 % for each higher tier. This part of the formula creates that array of commission rate factors: SEQUENCE(tiers,,1,-0.01)
So when the number of tiers is less than 100, the array will be {1;0.99;0.98;...} and never going below 0, but in your example with a large number of units sold (300000 units), we'll have 296 tiers and the sequence goes negative. To set a lower bound, I think it would make sense to generate this array with an IF function. To try it out, I changed the name of the original sequence to seqt (for the sequence related to the tier count, and then created a new variable named seqr to generate the original sequence for commission rates...and then seqr is fed into an IF statement to change commission rates to 0.01 where they dropped below 0.01. This is the formula to try that out, were B10 holds the quantity sold:
=LET(tiers,1+MAX(0,CEILING($B10-5000,1000))/1000,seqt,SEQUENCE(tiers,,1,1),seqr,SEQUENCE(tiers,,1,-0.01),IF(seqr<0.01,0.01,seqr))
Making this change, revising the references to seqt and also tweaking the IF(seqt=tiers statement to incorporate an IF function rather than the somewhat more convoluted original version, the revised formula looks like this:
MrExcel20220319.xlsx
ABCD
1Units SoldSales PriceTotal Commission
27001620912.91
312305419200.96
4250011.414250
5100163003
6510.5
795001046875
870000.6250.92
97000620910
103000006169380
Sheet2
Cell Formulas
RangeFormula
D2:D10D2=LET(tiers,1+MAX(0,CEILING($B2-5000,1000))/1000, seqt,SEQUENCE(tiers,,1,1),seqr,SEQUENCE(tiers,,1,-0.01), SUMPRODUCT(IF(seqr<0.01,0.01,seqr)*$C2*(0.5-MAX(0,0.1*(5-$C2))), IF(seqt=1,MIN(5000,$B2), IF(seqt<tiers,1000, IF(seqt=tiers,IF(MOD($B2,1000)=0,1000,$B2-FLOOR($B2,1000)) ))) ))

Please let me know if this yields expected values and if you encounter any other issues.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top