One formula to sum all lookup with different multiplication criteria

zedoud

New Member
Joined
Jul 3, 2018
Messages
5
Hi everyone,

I'm trying to solve this problem in an easy way. I have a database (1000s+ lines) with lines of sellers ID's and amount of sales over a time period. Each seller has a different commission percentage. I want to calculate the total amount of commission to be paid in one formula.

So far I have been doing this by having a different tab where I calculate the total commission calculate for each vendors with SUMIF and VLOOKUP:

For example for seller "AA" I want to have (1000+2200)*0.05:
=SUMIF(A:A;"AA";B:B)*VLOOKUP("AA";D:D;2)
And then sum the results I get of each seller vendors

Works fine but I want an easier way to do it in one short formula. Maybe using INDEX and Match? But I'm not to sure how to use it.


ABCDE
1SellerSold Value Commission Rule
2AA1000 AA5%
3BB1500 BB6%
4AA2200 CC4%
5CC3200
6BB2000

<colgroup><col span="2"><col><col span="3"></colgroup><tbody>
</tbody>

Thanks for your help!

P:S: Bonus if the formula includes a lookup for sellors with blank ID !
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Excel 2010
ABCDE
1SellerSold ValueCommission Rule
2AA1000AA5%
3BB1500BB6%
4AA2200CC4%
5CC3200
6BB2000
7
8498
Sheet1
Cell Formulas
RangeFormula
B8=SUMPRODUCT(SUMIF($D$2:$D$4,$A$2:$A$6,$E$2:$E$4),$B$2:$B$6)


what would a blank return?
 
Upvote 0
Thanks a lot! This works great!

A blank would return the sum of the value of sales of sellers without ID (blanks) * a fixed commission (7%)

If I don't want to modify the database, I could just add to your formula =SUMPRODUCT(SUMIF($D$2:$D$4,$A$2:$A$7,$E$2:$E$4),$B$2:$B$7)+SUMIF($A$2:$A$7,"",$B$2:$B$7)*0,07 (if line 7 was a seller with no ID)

Or could I include this in the SUMPRODUCT?

Thanks!

Thanks!
 
Upvote 0
If you add an ID of 0 blanks will be summed at the corresponding %:


Excel 2010
ABCDE
1SellerSold ValueCommission Rule
2AA1000AA5%
3BB1500BB6%
4AA2200CC4%
5320007%
6BB2000
7
8594
Sheet1
Cell Formulas
RangeFormula
B8=SUMPRODUCT(SUMIF($D$2:$D$5,$A$2:$A$6,$E$2:$E$5),$B$2:$B$6)
 
Last edited:
Upvote 0
Hi again,

I've been trying to add another criteria before multiplying. That is for example as below, only calculate for "Paris" seller. I've been trying with SUMIFS or adding array to the sumproduct formula but I either get nothing or error...

How could I add more criteria to the formula?

If you add an ID of 0 blanks will be summed at the corresponding %:

Excel 2010
ABCDE
1SellerSold ValuecityCommission Rule
2AA1000¨ParisAA5%
3BB1500NYCBB6%
4AA2200NYCCC4%
53200Paris07%
6BB2000NYC
7
8594

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

Worksheet Formulas
CellFormula
B8=SUMPRODUCT(SUMIF($D$2:$D$5,$A$2:$A$6,$E$2:$E$5),$B$2:$B$6)

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

<tbody>
</tbody>


Thanks!
 
Upvote 0

Excel 2010
ABCDE
1SellerSold ValuecityCommission Rule
2AA1000ParisAA5%
3BB1500NYCBB6%
4AA2200NYCCC4%
53200Paris07%
6BB2000NYC
7
8Paris274
Sheet9
Cell Formulas
RangeFormula
B8=SUMPRODUCT(SUMIF($D$2:$D$5,$A$2:$A$6,$E$2:$E$5),--($C$2:$C$6=A8),$B$2:$B$6)
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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