Weighted Avg If using SUMPRODUCT

vbaisdaxing

New Member
Joined
Aug 23, 2017
Messages
12
[TABLE="width: 500"]
<tbody>[TR]
[TD]ColumnA(amount)[/TD]
[TD]ColumnB(return%)[/TD]
[/TR]
[TR]
[TD]3100000[/TD]
[TD].0403[/TD]
[/TR]
[TR]
[TD]4800000[/TD]
[TD].1178[/TD]
[/TR]
[TR]
[TD]9200000[/TD]
[TD].0403[/TD]
[/TR]
[TR]
[TD]10300000[/TD]
[TD].1517[/TD]
[/TR]
[TR]
[TD]11000000[/TD]
[TD].0743[/TD]
[/TR]
[TR]
[TD]11200000[/TD]
[TD].0462[/TD]
[/TR]
[TR]
[TD]11700000[/TD]
[TD].0461[/TD]
[/TR]
[TR]
[TD]12000000[/TD]
[TD].0412[/TD]
[/TR]
[TR]
[TD]12800000[/TD]
[TD].0485[/TD]
[/TR]
[TR]
[TD]13400000[/TD]
[TD].0620[/TD]
[/TR]
</tbody>[/TABLE]


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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,225,740
Messages
6,186,759
Members
453,370
Latest member
juliewar

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