Sumproduct combined with a condition of subject to maximum

x0nar

New Member
Joined
May 10, 2016
Messages
34
Suppose I have the following data

Alex01/07/1810000
Mike09/07/1820000
Alex13/07/1835000
Jason13/11/1826000

<tbody>
</tbody>

Now, I'd like to find the maximum commission earned by a person for a month subject to the condition that for each transaction max commission earned cannot exceed 25000

Now consider an Employee Alex. Let's say we want to calculate commission earned by him for the month of July.
As we can see the commission earned by him would be 10000 + 25000 = 35000

Now how do I derive the answer without adding any helper row / column using just a single formula.

As far as I know either the sumproduct or sum with array function can be used and using both I am able to derive a formula except that it does not consider the max commission limit. Somehow I cannot get my head around the MIN Function part.

Appreciate your help.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

Does this help:


Book1
ABCDEFG
1Alex7/1/201810000Month to SumSalespersonResult
2Mike7/9/2018200007Alex25000
3Alex7/13/2018350007Mike20000
4Jason11/13/2018260007Jason25000
Sheet304
Cell Formulas
RangeFormula
G2=MIN(25000,SUMPRODUCT((A$1:A$4=F2)*(MONTH(B$1:B$4=E2)*C$1:C$4)))
 
Upvote 0
Hi,

Does this help:

ABCDEFG
1Alex7/1/201810000Month to SumSalespersonResult
2Mike7/9/2018200007Alex25000
3Alex7/13/2018350007Mike20000
4Jason11/13/2018260007Jason25000

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet304

Worksheet Formulas
CellFormula
G2=MIN(25000,SUMPRODUCT((A$1:A$4=F2)*(MONTH(B$1:B$4=E2)*C$1:C$4)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


Hi. Sorry for the late reply. I guess you misinterpreted my requirement. What I would prefer the function to perform is to cap the commission amount to $25000 per entry, and not month-wise.
So for instance if we consider the case of Alex, there appear to be two entries ie. on 1st July and 13th July. Now the commission on 1st July does not breach the cap,hence it would be considered in its entirety of $10000. However with regards to the commission on 13th July of $35000, it exceeds the $25000 Cap, hence only $25000 will be considered. So, Alex's commission for the month of July would amount to $35000.
What I believe your code does is it considers a cap value by the end of month resulting in an answer of $25000.

Any fix to this. Thank you for your reply
 
Upvote 0
Data in B2:D2
J2=Alex
K2=7
ARRAY formula In L2

=SUM(($B$2:$B$5=J2)*(MONTH($C$2:$C$5)=K2)*(IF($D$2:$D$5>25000,25000,$D$2:$D$5)))

How ARRAY formula is entered

Paste Formula in the cell.
Press F2
Hold Shift+ Ctrl Keys and hit Enter key.
Now the formula is surrounded by {} by excel.
 
Last edited:
Upvote 0
Data in B2:D2
J2=Alex
K2=7
ARRAY formula In L2

=SUM(($B$2:$B$5=J2)*(MONTH($C$2:$C$5)=K2)*(IF($D$2:$D$5>25000,25000,$D$2:$D$5)))

How ARRAY formula is entered

Paste Formula in the cell.
Press F2
Hold Shift+ Ctrl Keys and hit Enter key.
Now the formula is surrounded by {} by excel.

Hi @kvsrinivasamurthy. Thanks for your reply. It worked.
Somehow I am unable to get my head around this array part in Excel. I mostly have trouble understanding if a command would get inside an array or otherwise.
I would really appreciate if you could redirect me to a source/website/book which could help me understand the properties of Arrays in Excel and their collaboration with functions like SUM,SUMPRODUCT etc. I mean the way you figured it out, there must be some inherent logic to derive how to get commands inside an array.

Thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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