Subtotal with Sumproduct and Criteria

questionking

New Member
Joined
Sep 26, 2017
Messages
17
Looking to calculate a weighted average if there is a rate in column B, and then to be able to filter on other columns and have the subtotal update with the correct weighted average rate.

Below is a copy of the formula I have thus far, where column B lists the rates and column A lists the values.


=SUMPRODUCT($B$2:$B$1048576,$A$2:$A$1048576)/SUMIF($B$2:$B$1048576,"<>",$A$2:$A$1048576)


How can I get SUBTOTAL to work with this formula?


Thanks in advance for the help, it is much appreciated.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I give the cells with rate the name: rng_rate
The cells with value: rng_value

=SUMPRODUCT(SUBTOTAL(9,OFFSET(rng_value,ROW(rng_value)-MIN(ROW(rng_value)),0,1))*SUBTOTAL(9,OFFSET(rng_Rate,ROW(rng_Rate)-MIN(ROW(rng_Rate)),0,1)))/SUMPRODUCT((rng_Rate<>"")*SUBTOTAL(9,OFFSET(rng_value,ROW(rng_value)-MIN(ROW(rng_value)),0,1)))
 
Upvote 0
Thank you this worked. I just adjusted the rng_Rate and rng_value to the cells I needed. Your help is much appreciated!
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,173
Members
452,615
Latest member
bogeys2birdies

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