Help with SUMPRODUCT/Array Formula

DefiantEgg90

New Member
Joined
Apr 7, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am building a spreadsheet that calculates tiered commissions for salespeople at my company. So far I have built my sheet so that it looks at each commission tier in a separate row and calculates the appropriate amount for that tier. Then, a simple sum at the bottom calculates the total commission.

What I would like to do is figure out how to write a formula to get the total in a single formula, rather than calculate each line and then summing (this will make it a lot easier to scale my model for many salespeople and many transactions), but I can't figure out how to do it. I think it's some combination of SUMPRODUCT and/or an array formula. Could someone help? The yellow cell in F11 is what I would like to achieve in a single formula without all the precedent calculations in F7:10.

Commission-MrExcel.xlsx
ABCDEF
1Qualified Revenue50,000
2Cumulative Revenue430,000
3Prior Cumulative Revenue380,000
4
5Commission Scale
6MinMaxRateCommission
7-140,6250%-
8140,625400,00035%7,000.00
9400,000600,00040%12,000.00
10600,000999,999,99945%-
1119,000.00
Sheet1
Cell Formulas
RangeFormula
B3B3=B2-B1
F7:F10F7=MAX(MIN(CumRev,D7)-MAX(PriorCumRev,C7),0)*E7
F11F11=SUM(F7:F10)
Named Ranges
NameRefers ToCells
CumRev=Sheet1!$B$2B3, F7:F10
PriorCumRev=Sheet1!$B$3F7:F10
QualRev=Sheet1!$B$1B3
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Commission2022.xlsm
ABCD
1Qualified Revenue50,000.00
2CumRev430,000.00
3Prior Cumulative Revenue380,000.00
419,000.0019,000.00
5Commission ScaleRate
6Min
70.000
8140,625.000.35
9400,000.000.4
10600,000.000.45
11
3b
Cell Formulas
RangeFormula
B3B3=B2-B1
B4B4=SUMPRODUCT(--(B2>C7:C10),B2-C7:C10,D7:D10-D6:D9)-SUMPRODUCT(--(B3>C7:C10),B3-C7:C10,D7:D10-D6:D9)
C4C4=SUMPRODUCT(--(B2>aB),B2-aB,aR)-SUMPRODUCT(--(B3>aB),B3-aB,aR)


With the formula in C4, the Bracket Array is named aB and Rate Differential Array is named aR.

Review the formula in B4 for the full information on the particular arrays; select the range like c7:c10 in the formula and press F9.

If you already have the calculation for the previous cumulative amount, you could just subtract that amount.
 
Last edited:
Upvote 0
Solution
Commission2022.xlsm
ABCD
1Qualified Revenue50,000.00
2CumRev430,000.00
3Prior Cumulative Revenue380,000.00
419,000.0019,000.00
5Commission ScaleRate
6Min
70.000
8140,625.000.35
9400,000.000.4
10600,000.000.45
11
3b
Cell Formulas
RangeFormula
B3B3=B2-B1
B4B4=SUMPRODUCT(--(B2>C7:C10),B2-C7:C10,D7:D10-D6:D9)-SUMPRODUCT(--(B3>C7:C10),B3-C7:C10,D7:D10-D6:D9)
C4C4=SUMPRODUCT(--(B2>aB),B2-aB,aR)-SUMPRODUCT(--(B3>aB),B3-aB,aR)


With the formula in C4, the Bracket Array is named aB and Rate Differential Array is named aR.

Review the formula in B4 for the full information on the particular arrays; select the range like c7:c10 in the formula and press F9.

If you already have the calculation for the previous cumulative amount, you could just subtract that amount.
Beautiful, exactly what I was looking for. I'm not terribly familiar with the "--" syntax in SUMPRODUCT, other than I know it evaluates a statement to a Boolean value (I think). I'll have to read up on that. Thanks for the help!
 
Upvote 0
The double negative -- coerces True and False to 1 and 0 Which expedites some formulas. Arithmetic operations also coerce True and False to 1 and 0.
Try the 2 parts of the formula in distinct cells and then review the logic with Formulas Evaluate Formula.
 
Upvote 0
Commission2022.xlsm
ABCDEFGHIJ
1on cumulative revenue
2JanFebMarAprMayJunJulTotal
3 Sales120,000.00150,000.00110,000.0050,000.00430,000.00
4
5Commission0.0045,281.2538,500.0019,000.000.000.000.00102,781.25
6
7Total102,781.25
8
3b
Cell Formulas
RangeFormula
J3,J5J3=SUM(B3:H3)
B5:H5B5=SUMPRODUCT(--(SUM($B$3:B3)>aB),SUM($B$3:B3)-aB,aR)-SUM($A$5:A5)
J7J7=SUMPRODUCT(--(J3>aB),J3-aB,aR)


Try reviewing the formula with Formulas Evaluate Formula
I did not know this site would show the following when I posted the address; I hope that it works OK. see Excel Magic Trick 673

MrExcel posted a YouTube Video on this see
see Excel Magic Trick 673
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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