Sumproduct multi-tiered thresholds

KingCeli

New Member
Joined
Jan 29, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I'm trying to find out if there is a formula to calculate the monthly billing fee based on the below table.

I receive monthly reports from a customer. The below table shows the billing rate per product at each threshold level.
Below the table is an example of how it is supposed to be calculated.
Starting with 9000 units of Product A and 1000 units from Product B bill at their respective first threshold rates, and then so on with Product C, D,..H.
I'm familiar with using Sumproducts to discount from the total at different levels, but that would only work on one product. I don't know how I would go about writing a formula for these many products.

I would very much appreciate help with this problem, I would waste too much time at work figuring it out on my own and this is the only customer that has their payment like this.


Book1
BCDEFGHIJ
4ThresholdsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
51 to 10,000$1.35$1.21$1.18$1.09$1.02$0.87$0.82$0.71
610,001 to 50,000$1.28$1.15$1.12$1.03$0.97$0.83$0.81$0.67
750,001 to 100,000$1.22$1.09$1.07$0.98$0.92$0.79$0.77$0.64
8100,001 to 250,000$1.16$1.03$1.01$0.93$0.87$0.75$0.73$0.61
9250,001 to 500,000$1.10$0.98$0.96$0.89$0.83$0.71$0.69$0.58
10500,001 to 750,000$1.40$0.93$0.92$0.84$0.79$0.68$0.66$0.55
11750,001 to 1,000,000$0.99$0.89$0.87$0.80$0.75$0.64$0.62$0.52
121,000,001 to 3,000,000 $0.94$0.84$0.82$0.76$0.71$0.61$0.59$0.50
13
14Sample Fee Calculation:
15Product A – 9000 units
16Product B – 12000 units
17Product C – 5000 units
18Product D – 10000 units
19Product E – 2000 units
20Product F – 7000 units
21Product G – 1000 units
22Product H – 25000 units
23
24Fee Calculation = (1.35×9000(A)) + (1.21×1000(B)) + (1.15×11000(B)) + (1.12×5000(C)) + (1.03×10000(D)) + (.97×2000(E)) + (.83×7000(F)) + (.81×1000(G)) + (.67×4000(H)) + (.64×21000(H)) = $66,590.00
Sheet1
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I don't think your B product calculation is correct. I tried a slightly different approach to allow the formula to be filled.
Will this work? I think I calculated correctly. Obviously, check the math.

Book1
ABCDEFGHIJ
1Low ThreshHigh ThreshProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
2110000$1.35 $1.21 $1.18 $1.09 $1.02 $0.87 $0.82 $0.71
31000150000$1.28 $1.15 $1.12 $1.03 $0.97 $0.83 $0.81 $0.67
450001100000$1.22 $1.09 $1.07 $0.98 $0.92 $0.79 $0.77 $0.64
5100001250000$1.16 $1.03 $1.01 $0.93 $0.87 $0.75 $0.73 $0.61
6250001500000$1.10 $0.98 $0.96 $0.89 $0.83 $0.71 $0.69 $0.58
7500001750000$1.40 $0.93 $0.92 $0.84 $0.79 $0.68 $0.66 $0.55
87700011000000$0.99 $0.89 $0.87 $0.80 $0.75 $0.64 $0.62 $0.52
910000013000000$0.94 $0.84 $0.82 $0.76 $0.71 $0.61 $0.59 $0.50
10
1190001200050001000020007000100025000
12FEE$12,150.00 $14,400.00 $5,900.00 $10,900.00 $2,040.00 $6,090.00 $820.00 $17,150.00
Sheet8
Cell Formulas
RangeFormula
C12:J12C12=MIN(C11,$B2)*C2+MAX(0,MIN($B3-$B2,C11-$B2))*C3+MAX(0,MIN($B4-$B3,C11-$B3))*C4+MAX(0,MIN($B5-$B4,C11-$B4))*C5+MAX(0,MIN($B6-$B5,C11-$B5))*C6+MAX(0,MIN($B7-$B6,C11-$B6))*C7+MAX(0,MIN($B8-$B7,C11-$B7))*C9+MAX(0,MIN($B9-$B8,C11-$B8))*C9
 
Upvote 0
Book1
CDEFGHIJKL
4ThresholdsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
5
60$1.35 $1.21 $1.18 $1.09 $1.02 $0.87 $0.82 $0.71
710,000$1.28 $1.15 $1.12 $1.03 $0.97 $0.83 $0.81 $0.67
850,000$1.22 $1.09 $1.07 $0.98 $0.92 $0.79 $0.77 $0.64
9100,000$1.16 $1.03 $1.01 $0.93 $0.87 $0.75 $0.73 $0.61
10250,000$1.10 $0.98 $0.96 $0.89 $0.83 $0.71 $0.69 $0.58
11500,000$1.40 $0.93 $0.92 $0.84 $0.79 $0.68 $0.66 $0.55
12750,000$0.99 $0.89 $0.87 $0.80 $0.75 $0.64 $0.62 $0.52
131,000,000$0.94 $0.84 $0.82 $0.76 $0.71 $0.61 $0.59 $0.50
14
15
16
17Sample Fee Calculation:9,00012,0005,00010,0002,0007,0001,00025,000
1812,15014,4005,90010,9002,0406,09082017,15069,450
19
9b
Cell Formulas
RangeFormula
D18:K18D18=SUMPRODUCT(--(D17>$C$6:$C$13),D17-$C$6:$C$13,D6:D13-D5:D12)
L18L18=SUM(D18:K18)
 
Upvote 0
Dave: nice use of SUMPRODUCT. Didn't think of that initially when I was plowing through the calculation logic.
 
Upvote 0
I don't think I explained it right. All the products need to be calculated cumulatively and starting with Product A. so the 9000 units will be calculated at @ $1.35 first then 1000 from Product B @$1.21 towards the first threshold. Then the remaining units of B (11000) billed at $1.15. Product C-G and 4000 of H making 50,000 units billed at the second level threshold. the last 21,000 units for H are billed at the third threshold rate $.64.
 
Upvote 0
I do not follow your explanation.
The example below assumes that you have previous amounts.
You have new amounts for the current period (month).
The calculation is based on the total.
The amount for the current month would be the new total - previous amount.
If this is not what you require, please post an example of your actual challenge.

Book1
CDEFGHIJKL
2BracketsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
3blank row
401.35 1.21 1.18 1.09 1.02 0.87 0.82 0.71
510,0001.28 1.15 1.12 1.03 0.97 0.83 0.81 0.67
650,0001.22 1.09 1.07 0.98 0.92 0.79 0.77 0.64
7100,0001.16 1.03 1.01 0.93 0.87 0.75 0.73 0.61
8250,0001.10 0.98 0.96 0.89 0.83 0.71 0.69 0.58
9500,0001.40 0.93 0.92 0.84 0.79 0.68 0.66 0.55
10750,0000.99 0.89 0.87 0.80 0.75 0.64 0.62 0.52
111,000,0000.94 0.84 0.82 0.76 0.71 0.61 0.59 0.50
12
13Previous5,0005,0005,0005,0005,0005,0005,0005,000
14Current10,00010,00016,00022,00028,00034,00040,00046,000
15Total15,00015,00021,00027,00033,00039,00045,00051,000
16Amount19,90017,85024,12028,41032,51032,77036,55034,540226,650
17Previous
18Current
9b
Cell Formulas
RangeFormula
D15:K15D15=D13+D14
D16:K16D16=SUMPRODUCT(--(D15>$C$4:$C$11),D15-$C$4:$C$11,D4:D11-D3:D10)
L16L16=SUM(D16:K16)
 
Upvote 0
Apologies, this customer's agreement is overly complicated.
The example below is how I would calculate the long way the total amount due for October.

All the reported units count toward the tiered thresholds but need to be calculated in order from A-H.


Book1
BCDEFGHIJ
4ThresholdsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
51 to 10,000$1.35$1.21$1.18$1.09$1.02$0.87$0.82$0.71
610,001 to 50,000$1.28$1.15$1.12$1.03$0.97$0.83$0.81$0.67
750,001 to 100,000$1.22$1.09$1.07$0.98$0.92$0.79$0.77$0.64
8100,001 to 250,000$1.16$1.03$1.01$0.93$0.87$0.75$0.73$0.61
9250,001 to 500,000$1.10$0.98$0.96$0.89$0.83$0.71$0.69$0.58
10500,001 to 750,000$1.40$0.93$0.92$0.84$0.79$0.68$0.66$0.55
11750,001 to 1,000,000$0.99$0.89$0.87$0.80$0.75$0.64$0.62$0.52
121,000,001 to 3,000,000 $0.94$0.84$0.82$0.76$0.71$0.61$0.59$0.50
13
14October ReportingThresold reached
15Product A1500010000Product A 10,000 $1.35$13,500.00
16Product B48000Product A 5,000 $1.28$6,400.00
17Product C5200050000Product B 35,000 $1.15$40,250.00
18Product D60000Product B 13,000 $1.09$14,170.00
19Product E98000100000Product C 37,000 $1.07$39,590.00
20Product F150000Product C 15,000 $1.01$15,150.00
21Product G142000Product D 60,000 $0.93$55,800.00
22Product H950000250000Product E 75,000 $0.87$65,250.00
231515000Product E 23,000 $0.83$19,090.00
24Product F 150,000 $0.71$106,500.00
25500000Product G 77,000 $0.69$53,130.00
26Product G 65,000 $0.66$42,900.00
27750000Product H 185,000 $0.55$101,750.00
281000000Product H 250,000 $0.52$130,000.00
29Product H 515,000 $0.50$257,500.00
30 $960,980.00
Sheet2
Cell Formulas
RangeFormula
C23C23=SUM(C15:C22)
H15H15=F15
H16H16=C15-H15
H17H17=F17-H16-H15
H18H18=C16-H17
H19H19=F19-H18-H17-H16-H15
H20H20=C17-H19
H21H21=C18
H22H22=F22-H21-H20-H19-H18-H17-H16-H15
H23H23=C19-H22
H24H24=C20
H25H25=F25-H24-H23-H22-H21-H20-H19-H18-H17-H16-H15
H26H26=C21-H25
H27H27=F27-H26-H25-H24-H23-H22-H21-H20-H19-H18-H17-H16-H15
H28H28=F28-H27-H26-H25-H24-H23-H22-H21-H20-H19-H18-H17-H16-H15
H29H29=C22-H28-H27
J15:J29J15=H15*I15
J30J30=SUM(J15:J29)
 
Upvote 0
This post calculates just for product H.
Hopefully it answers your question.

Book1
CDEFGHIJK
2BracketsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct H
3blank row
401.35 1.21 1.18 1.09 1.02 0.87 0.82 0.71
510,0001.28 1.15 1.12 1.03 0.97 0.83 0.81 0.67
650,0001.22 1.09 1.07 0.98 0.92 0.79 0.77 0.64
7100,0001.16 1.03 1.01 0.93 0.87 0.75 0.73 0.61
8250,0001.10 0.98 0.96 0.89 0.83 0.71 0.69 0.58
9500,0001.40 0.93 0.92 0.84 0.79 0.68 0.66 0.55
10750,0000.99 0.89 0.87 0.80 0.75 0.64 0.62 0.52
111,000,0000.94 0.84 0.82 0.76 0.71 0.61 0.59 0.50
12
13Previous565,000
14October950,000
15Total00000001,515,000
16Amount0000000827,400
17Previous338,150
18Current489,250
19
9b
Cell Formulas
RangeFormula
D15:K15D15=D13+D14
D16:K16D16=SUMPRODUCT(--(D15>$C$4:$C$11),D15-$C$4:$C$11,D4:D11-D3:D10)
K18K18=K16-K17
 
Upvote 0
Sorry, it does not, thanks for trying, I guess I'm not explaining it right.
 
Upvote 0
You can consider the cumulative amount with the SumProduct.
Review the previous posts and/or the following.

Book1
CDEFGHIJKL
2BracketsProduct AProduct BProduct CProduct DProduct EProduct FProduct GProduct HTotal
3blank row
401.35 1.21 1.18 1.09 1.02 0.87 0.82 0.71
510,0001.28 1.15 1.12 1.03 0.97 0.83 0.81 0.67
650,0001.22 1.09 1.07 0.98 0.92 0.79 0.77 0.64
7100,0001.16 1.03 1.01 0.93 0.87 0.75 0.73 0.61
8250,0001.10 0.98 0.96 0.89 0.83 0.71 0.69 0.58
9500,0001.40 0.93 0.92 0.84 0.79 0.68 0.66 0.55
10750,0000.99 0.89 0.87 0.80 0.75 0.64 0.62 0.52
111,000,0000.94 0.84 0.82 0.76 0.71 0.61 0.59 0.50
12
13October15,00048,00052,00060,00098,000150,000142,000950,000
14Cumulative15,00063,000115,000175,000273,000423,000565,0001,515,000
1515,00063,000115,000175,000273,000423,000565,000
16Amount19,90072,270125,250170,850244,590316,730404,000827,4002,180,990
17Less017,85070,510115,050160,250210,230307,970338,1501,220,010
18Oct Amount19,90054,42054,74055,80084,340106,50096,030489,250960,980
9b
Cell Formulas
RangeFormula
E14:K14E14=SUM($D$13:E13)
E15:K15E15=E14-E13
D16:K16D16=SUMPRODUCT(--(D14>$C$4:$C$11),D14-$C$4:$C$11,D4:D11-D3:D10)
L16:L18L16=SUM(D16:K16)
D17:K17D17=SUMPRODUCT(--(D15>$C$4:$C$11),D15-$C$4:$C$11,D4:D11-D3:D10)
D18:K18D18=D16-D17
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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