Weighted average while omitting cells from an array

UndwaterExcelWeaver

New Member
Joined
Mar 2, 2019
Messages
38
Office Version
  1. 365
Platform
  1. Windows
I understand how to do a basic weighted average using sumproduct but I cannot figure out how to do this when there are rows within the array that I do not want to be included. I have tried adding and subtracting multiple sumproducts and sums and even tried the vstack formula but nothing seems to return the accurate results. Sorry, I couldn't get the xl2bb to capture this. I need to calculate the weighted average in cells D18:G18. I need it to use the values in rows 12, 13, and 16, but omit rows 14 and 15. How do I accomplish this?

View attachment 91947

Nancy Cooker Water Produced
20814​
22.670.5020.38(2.29)
String Make Cook Water Produced
38997​
0.420.000.00-0.42
Sweet Cream from Milk Reception0.00
Site Total From EOD Totalizer156,37530.20%0.50%31.96%1.76%
Total Mozz produced using site total9656411.600.0812.310.71
-30.00%0.50%31.93%1.93%
Total Inventory (Using formula)156,375
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You'd basically just expand the SUMPRODUCT you're already using to exclude the criterion.

For example, if you currently have:

Code:
 =SUMPRODUCT(C12:C16,D12:D16)/SUM(C12:C16)

You could expand that to be something like:

Code:
 =SUMPRODUCT(C12:C16,D12:D16,--(B12:B16<>"String Make Cook Water Produced"))/SUMPRODUCT(C12:C16,--(B12:B16<>"String Make Cook Water Produced"))

Your actual criteria will no doubt differ, but the general construct is there.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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