SUMPRODUCT assistance

excel_caveman

New Member
Joined
May 3, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello, I have found a couple of threads that look like they would help, but they haven't quite got the right answer. I am trying to use SUMPRODUCT (can't use macros etc.) to calculate the price of a contract based on the volume of units sold. The unit price is determined by a cumulative tiered pricing model. As an example, someone purchasing 800 units should be charged (250 x $20) + (250 x $17.5) + (250 x $15) + (50 x $12.5)= $13,750. Table starts in cell A1, so B2 in the formula below is referencing the 250 in the To column, and B11 is where I am entering the volume to be caluclated.


FromToUnit price
0250$20.0
251500$17.5
501750$15.0
7511,000$12.5
1,0011,500$10.0
1,5012,000$7.5
2,0012,500$5.0
2,501100,000$2.5

I have used the following, but it does not seem to be working =SUMPRODUCT((B11>{0;B2;B3;B4;B5;B6;B7;B8;B9})*(B11-{0;B2;B3;B4;B5;B6;B7;B8;B9})*{0;C2;C3;C4;C5;C6;C7;C8;C9})

Thanks in advance
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
MrExcelPlayground16.xlsx
ABC
1FromToUnit price
21250$20.00
3251500$17.50
4501750$15.00
57511,000$12.50
61,0011,500$10.00
71,5012,000$7.50
82,0012,500$5.00
92,501100,000$2.50
10
11800
12
1313750
Sheet28
Cell Formulas
RangeFormula
B13B13=SUMPRODUCT(--(B11>B2:B9),C2:C9*(1+B2:B9-A2:A9))+SUMPRODUCT((B11>=A2:A9)*(B11<=B2:B9),C2:C9*(1+B11-A2:A9))
 
Upvote 0
Solution
With Excel 365, you can use Sum.
I named the bracket information aB and the rate differential aR see the second example

Commissions 2023.xlsm
ABCD
1BracketsUnit Price
2020.00
325017.50
450015.00
575012.50
6100010.00
715007.50
820005.00
925002.50
10
1180013,750.0013,750.00
12
1f
Cell Formulas
RangeFormula
C11C11=SUM((B11>AB)*(B11-AB)*aR)
D11D11=SUMPRODUCT(--(B11>AB),(B11-AB),aR)


Commissions 2023.xlsm
ABCDEF
1BracketsUnit PriceDifferential
2020.0020.00
325017.50-2.50
450015.00-2.50
575012.50-2.50
6100010.00-2.50
715007.50-2.50
820005.00-2.50
925002.50-2.50
10
1180013,750.0013,750.0013,750.0013,750.00
12
1f
Cell Formulas
RangeFormula
C2:C9C2=B2-N(B1)
C11C11=SUM((B11>AB)*(B11-AB)*aR)
D11D11=SUMPRODUCT(--(B11>A2:A9),(B11-A2:A9),C2:C9)
E11E11=SUM((B11>A2:A9)*(B11-A2:A9)*C2:C9)
F11F11=SUMPRODUCT(--(B11>A2:A9),(B11-A2:A9),C2:C9)
 
Upvote 0
With Excel 365, you can use Sum.
I named the bracket information aB and the rate differential aR see the second example

Commissions 2023.xlsm
ABCD
1BracketsUnit Price
2020.00
325017.50
450015.00
575012.50
6100010.00
715007.50
820005.00
925002.50
10
1180013,750.0013,750.00
12
1f
Cell Formulas
RangeFormula
C11C11=SUM((B11>AB)*(B11-AB)*aR)
D11D11=SUMPRODUCT(--(B11>AB),(B11-AB),aR)


Commissions 2023.xlsm
ABCDEF
1BracketsUnit PriceDifferential
2020.0020.00
325017.50-2.50
450015.00-2.50
575012.50-2.50
6100010.00-2.50
715007.50-2.50
820005.00-2.50
925002.50-2.50
10
1180013,750.0013,750.0013,750.0013,750.00
12
1f
Cell Formulas
RangeFormula
C2:C9C2=B2-N(B1)
C11C11=SUM((B11>AB)*(B11-AB)*aR)
D11D11=SUMPRODUCT(--(B11>A2:A9),(B11-A2:A9),C2:C9)
E11E11=SUM((B11>A2:A9)*(B11-A2:A9)*C2:C9)
F11F11=SUMPRODUCT(--(B11>A2:A9),(B11-A2:A9),C2:C9)
Awesome thank you. Will give these a go as well :)
 
Upvote 0
Thanks for the feedback.

With Excel 365, you can build your own self-contained formula with Lambda.

Commissions 2023.xlsm
BC
1480013,750.00
15300028,750.00
1610200.00
1f
Cell Formulas
RangeFormula
C14:C16C14=Pricex(B14)


Use name manager see Formulas Name Manager and named the function something relevant.
I do not know the name that you would use; my example uses Pricex.

New name Pricex
Value =LAMBDA(Units,LET(b,{0;250;500;750;1000;1500;2000;2500},r,{20;-2.5;-2.5;-2.5;-2.5;-2.5;-2.5;-2.5},SUM((Units>b)*(Units-b)*r)))
Use Pricex like a regular function; it will show the required parameter "Units" .
examples =Pricex(B11) or =Pricex(800)
 
Upvote 0
Thanks for the feedback.

With Excel 365, you can build your own self-contained formula with Lambda.

Commissions 2023.xlsm
BC
1480013,750.00
15300028,750.00
1610200.00
1f
Cell Formulas
RangeFormula
C14:C16C14=Pricex(B14)


Use name manager see Formulas Name Manager and named the function something relevant.
I do not know the name that you would use; my example uses Pricex.

New name Pricex
Value =LAMBDA(Units,LET(b,{0;250;500;750;1000;1500;2000;2500},r,{20;-2.5;-2.5;-2.5;-2.5;-2.5;-2.5;-2.5},SUM((Units>b)*(Units-b)*r)))
Use Pricex like a regular function; it will show the required parameter "Units" .
examples =Pricex(B11) or =Pricex(800)
Thank you. I am not familiar with LAMBDA, but I will take some time to understand it and put it into practice. Thanks for your help. Really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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