How can I use SUMPRODUCT on an *unsorted* table to return a weighted average?

d0rian

Active Member
Joined
May 30, 2015
Messages
313
Office Version
  1. 365
See image below, I think it's clear. I want the formula I need to put into cell H2 (green highlight) to generate the weighted average (of rows that meet a certain criteria -- in this case AAPL stock). I then want to be able to copy the formula down (to cells H3:H5) so it calculates the same for all stocks.

I know that SUMPRODUCT would do the trick if the source table consisted of ONLY rows of AAPL stock (like i show in the RED cells), but my table is large with hundreds of symbols. Seems like I need some combo of SUMPRODUCT and SUMIF...maybe a SUMPRODUCTIF, but that doesn't exist...


2WYBYIE.jpg
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try:

=SUMPRODUCT(--($B$2:$B$15=$F2), $C$2:$C$15, $D$2:$D$15)/G2
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

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