Weighted Average with sumif

DataLytic

New Member
Joined
Mar 15, 2018
Messages
2
Hi I would like get weighted average margin by category.
I want to use the sales to weight the margins.
Any help? thanking in advance

ABCD
1Invoice NumberProductSalesMargin
222Pen11015%
328Books20011%
426Rubber22025%
532Ink12565%
6152Pen22548%
7225Books45154%
8365Rubber22522%
9445Ink14515%
10224Pen3648%
11257Books4565%
1245Rubber88933%
136987Ink545%
14
15 Weighted Average Margin
16 Pen ?
17 Books ?
18 Rubber ?
19 Ink ?

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

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Data

I have recently been faced with a similar task, and this is the formula I used on your data.

=SUMPRODUCT(--($C$3:$C$14="Pen"),$E$3:$E$14,$D$3:$D$14)/SUMIFS($D$3:$D$14,$C$3:$C$14,"Pen")

You can type in the name "pen/Product" or select the cell in the column to the left.

Let me know if this helps?

Thanks
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,718
Members
448,294
Latest member
jmjmjmjmjmjm

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