Sum Product Array Issue

nlitedesign

New Member
Joined
Jun 17, 2018
Messages
8
Hello All,

Could someone please point out where my problem is within the following equation.

=SUMPRODUCT(--(A1>{0;5000;10000;20000}), (A1-{0;5000;10000;20000}), {0.01;0.0075;0.005;0.0025})

The equation is to work out a fee on a tabled scale (as follows):

ValueFee
£0 > £5,0001.00%
£5001 > £10,0000.75%
£10,001 > £20,0000.50%
£20,001 and Over0.25%

The correct answer is £213.89 but for some reason I keep getting £1126.422 as the answer...

I know it is probably something obvious, but i just cant see it now..

Thanks in advance

Keep Safe.

Phil
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
In the example you have given, you are applying a fee based on all of the categories.
If A1 = 50556.89 it passes all of the tests (A1>{0;5000;10000;20000}) and your formula is calculating the sum of all possible fees.
 
Upvote 0
In the example you have given, you are applying a fee based on all of the categories.
If A1 = 50556.89 it passes all of the tests (A1>{0;5000;10000;20000}) and your formula is calculating the sum of all possible fees.
Yes that is correct.. for the first £5000 I pay 1%, then £5001 to £10000 I pay 0.75% and so on.. this adds up to £213.89.. Well it should... but I keep getting the higher £1126 answer...
 
Upvote 0
The problem is that formula is paying 1+.75+.5+.25 on the first 5000, that first 5000 is getting into all four bins.

Try
=MIN(A1,5000)*0.01+ MAX(0,MIN(10000,A1-5000))*0.0075 + MAX(0,MIN(20000,A1-10000))*0.0005 + MAX(0,A1-20000)*0.0025
 
Upvote 0
=SUMPRODUCT(--(A1>{0;5000;10000;20000}), (A1-{0;5000;10000;20000}), {0.01;-0.0025;-0.0025;-0.0025})

Check the rates
 
Upvote 0
Commission2020.xlsm
CDE
1Number50,556.89
2Calculated213.89
3 as above criteria in formula213.89
4 as above without named range213.89
5
6Bracket [rB]RateRate Delta [rR]
701.00%1.00%
85,0000.75%-0.25%
910,0000.50%-0.25%
1020,0000.25%-0.25%
11
Commission
Cell Formulas
RangeFormula
D2D2=SUMPRODUCT(--(D1>rB),D1-rB,rR)
D3D3=SUMPRODUCT(--(D1>{0;5000;10000;20000}),D1-{0;5000;10000;20000},{0.01;-0.0025;-0.0025;-0.0025})
D4D4=SUMPRODUCT(--(D1>C7:C10),D1-C7:C10,E7:E10)
E7:E10E7=D7-N(D6)
Named Ranges
NameRefers ToCells
rB=Commission!$C$7:$C$10D4, D2
rR=Commission!$E$7:$E$10D4, D2
 
Upvote 0
Commission2020.xlsm
ABCD
150,556.89Number
2Calculated213.89
3 as above criteria in formula213.89
4 as above without named range213.89
5 Arithmetic213.89
6
7Bracket [rB]RateRate Delta [rR]
801.00%1.00%
95,0000.75%-0.25%
1010,0000.50%-0.25%
1120,0000.25%-0.25%
Commission
Cell Formulas
RangeFormula
C2C2=SUMPRODUCT(--(A1>rB),A1-rB,rR)
C3C3=SUMPRODUCT(--(A1>{0;5000;10000;20000}),A1-{0;5000;10000;20000},{0.01;-0.0025;-0.0025;-0.0025})
C4C4=SUMPRODUCT(--(A1>B8:B11),A1-B8:B11,D8:D11)
C5C5=MIN(A1,5000)*0.01+ MAX(0,MIN(5000,A1-5000))*0.0075 + MAX(0,MIN(10000,A1-10000))*0.005 + MAX(0,A1-20000)*0.0025
D8:D11D8=C8-N(C7)
Named Ranges
NameRefers ToCells
rB=Commission!$B$8:$B$11C4, C2
rR=Commission!$D$8:$D$11C4, C2
 
Upvote 0
=SUMPRODUCT(--(A1>{0;5000;10000;20000}), (A1-{0;5000;10000;20000}), {0.01;-0.0025;-0.0025;-0.0025})

Check the rates
Hi Dave,

Thank you very much for your help, it is much appreciated.

That is great its works.. I think I understand a majority of the formula, the only question I do have is..
What is happening where you changed the percentage to " -0.0025 ". The reason why I ask is that I have a fe of these fee tables to work with, and the are not all as easy as a 1/4 of a percent difference each drop. When i first researched this formula with regards to stamp duty in the UK, it had the exact values on each side of the array. Is there a way you entering the exact % on the right hand side of the array?

Thanks again
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,726
Members
449,465
Latest member
TAKLAM

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