Based on the date in cell A1, I would like to make a dynamic weight average. For this specific Example I would get the start of the year for my beginning date criteria with the following formula: DATE(YEAR$A$1),1,1)) and I would get the end date for my range by using: EOMONTH($A$1,0). Those would produce the date range of 1/1/23 - 8/31/23. Based on that range criteria, I would like to get the weighted average Retained rate in column B using column D, Total Balance, as the weight.
Formula I thought would work but not returning he result I wanted is:
=SUMPRODUCT(--($A$3:$A$50>=DATE(YEAR($A$1),1,1))--($A$3:$A$50<=EOMONTH($A$1,0)),($B$3:$B$50))/SUMPRODUCT(--($A$3:$A$50>=DATE(YEAR($A$1),1,1))--($A$3:$A$50<=EOMONTH($A$1,0)),($D$3:$D$50))
Any help on this would be much appreciated so I don't have to use the static =SUMPRODUCT(B39:B46,D39:D46)/SUM(D39:D46) weighted average formula and adjust the range when I load in new data. The desired result is 80.09% weighted average %. Thank you in advance
Formula I thought would work but not returning he result I wanted is:
=SUMPRODUCT(--($A$3:$A$50>=DATE(YEAR($A$1),1,1))--($A$3:$A$50<=EOMONTH($A$1,0)),($B$3:$B$50))/SUMPRODUCT(--($A$3:$A$50>=DATE(YEAR($A$1),1,1))--($A$3:$A$50<=EOMONTH($A$1,0)),($D$3:$D$50))
Any help on this would be much appreciated so I don't have to use the static =SUMPRODUCT(B39:B46,D39:D46)/SUM(D39:D46) weighted average formula and adjust the range when I load in new data. The desired result is 80.09% weighted average %. Thank you in advance