Weighted Avg If using SUMPRODUCT

vbaisdaxing

New Member
Joined
Aug 23, 2017
Messages
12
ColumnA(amount)ColumnB(return%)
3100000.0403
4800000.1178
9200000.0403
10300000.1517
11000000.0743
11200000.0462
11700000.0461
12000000.0412
12800000.0485
13400000.0620

<tbody>
</tbody>


Hello everyone,

I wanted to to calculate the weighted average based on a specified range. For example, I would like to be able to enter into cell C1 and D1 which will be the beginning and ending amounts and have a weighted average calcualte based off of my cell selection. For example, assuming i wanted a amount of range of $9,000,000 - $12,000,000, I was able to attain the calculation utilizing SUMPRODUCT(a3:a8,b3:b8)/SUM(a3:a8) and attained 6.58% weighted average. Hence, I'm trying to make this formula more dynamic based off of my selection in cell C1 and D1.

Any suggestions would be greatly appreciated.

Thanks,
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try

=SUMPRODUCT(A1:A10,B1:B10,--(A1:A10>=C1),--(A1:A10<=D1))/SUMIFS(A1:A10,A1:A10,">="&C1,A1:A10,"<="&D1)

where
C1=9,000,000
D1=12,000,000

M.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

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