Conditional weighted average for all but one in a range

tblackwell

New Member
Joined
Oct 24, 2018
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Trying to get a weighted average of sales for all employees except "7407 - NPX". In the example I have shown the long way to do this, but looking for a different way because the employee names and positions frequently switch in the table.

I tried:
SUMPRODUCT(--($A$15:$A$25<>A2),$C$15:$C$25,$B$15:$B$25)/SUMIF($A$15:$A$25,<>A2,$B$15:$B$25)
The SUMPRODUCT forumula works, the SUMIF does not. Can you help?

Book1
ABC
1Weighted average for all but:
27407 - NPX
3
4
5
6
7
8
9
10
11
12
13
14Employee# clientssales
1570 - HOLLAND,1$121,470
16447 - SIDDOWAY1$109,803
17462 - DRAKE,2$165,039
18551 - TAGGART, 3$108,615
19960 - BENDER,2$182,537
201496 - DROLLINGER,1$193,258
211715 - TURNER,18$126,305
224701 - OLSEN,1$117,345
235186 - PUMPHREY,6$108,229
247407 - NPX52$111,348
2512186 - BYU0$0
26
27
28Expected Result:$131,933
29
30Formula tried:SUMPRODUCT(--($A$15:$A$25<>A2),$C$15:$C$25,$B$15:$B$25)/SUMIF($A$15:$A$25,<>A2,$B$15:$B$25)
Sheet1
Cell Formulas
RangeFormula
C28C28=SUM(C$15*$B$15,C$16*B$16,C$17*$B$17,C$18*$B$18,C$19*$B$19,C$20*$B$20,C$21*$B$21,C$22*$B$22,C$23*$B$23,C$25*$B$25)/SUM($B$15,$B$17,$B$18,$B$19,$B$20,$B$21,$B$22,$B$23,$B$25)
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
@tblackwell Amend the SUMIF condition parameter of your formula
SUMPRODUCT(--($A$15:$A$25<>A2),$C$15:$C$25,$B$15:$B$25)/SUMIF($A$15:$A$25,"<>" &A2,$B$15:$B$25)

Also, I think you will find that your Expected Result above is incorrect as you have missed $B$16 from the SUM

Hope that helps.
 
Upvote 0
And....that worked! Thank you @Snakehips. I was close but you sealed the deal! And you were right I was missing $B$16, all the more reason to change to the new formula. Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,916
Members
449,093
Latest member
dbomb1414

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