Conditional Weighted Average Formula

DarkNight

New Member
Joined
Apr 25, 2017
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm looking to write a weighted average formula into column R in the below workbook. The Values are in $K$1:$Q$1. The Weights are in $K3:$Q3.
The condition: There is a header column in cells $K2:$Q2. The corresponding header between cells $C2:$I2 can't be 0 for the same row the formula is written on. If it is 0 than that value in columns K:Q shouldn't be considered in the weighted average.

thank you and let me know if you have any questions!


Help.xlsx
BCDEFGHIJKLMNOPQR
132%200%200%60%110%100%82%
2NameAppleBananaPearBlueberryApricotCherryGrapeAppleBananaPearBlueberryApricotCherryGrapeWeighted Average
3Cillian Thornton0%36%64%0%0%0%0%$ -$ -$ 43,900$ -$ -$ -$ -
4Luciano Atkinson0%0%0%41%0%59%0%$ -$ -$ -$ 72,200$ -$ 49,100$ -
5Kiaan Brooks0%0%0%0%85%15%0%$ -$ -$ -$ -$ 85,000$ -$ -
6Mack Ford0%0%89%0%11%0%0%$ -$ -$ -$ -$ -$ -$ -
7Augustus Williams0%0%0%0%0%55%45%$ -$ -$ -$ -$ -$ 86,400$ 84,200
8Dax Robinson0%17%0%0%0%83%0%$ -$ 79,200$ -$ -$ -$ -$ -
9Elliot Page46%54%0%0%0%0%0%$ 70,100$ -$ -$ -$ -$ -$ -
10Noel Peterson0%0%0%0%0%75%25%$ -$ -$ -$ -$ -$ 81,000$ 39,600
11Clyde Valdez0%0%15%0%0%85%0%$ -$ -$ 90,700$ -$ -$ 94,400$ -
12Leonidas Adkins0%26%0%74%0%0%0%$ -$ 14,600$ -$ 69,100$ -$ -$ -
13Titus Silva93%0%7%0%0%0%0%$ 13,600$ -$ 14,500$ -$ -$ -$ -
14Killian Barnett86%0%0%14%0%0%0%$ 77,300$ -$ -$ 87,600$ -$ -$ -
15Andres Miles77%0%23%0%0%0%0%$ 52,600$ -$ 26,300$ -$ -$ -$ -
16Cairo Moody0%0%79%0%0%21%0%$ -$ -$ -$ -$ -$ 35,100$ -
17Yahir Frazier0%0%0%89%0%11%0%$ -$ -$ -$ 27,200$ -$ 29,100$ -
18Sonny Nelson0%0%29%0%0%0%71%$ -$ -$ 80,900$ -$ -$ -$ 29,000
19Collin Curtis0%34%66%0%0%0%0%$ -$ 11,300$ 91,300$ -$ -$ -$ -
20Truett Fisher0%0%0%0%0%57%43%$ -$ -$ -$ -$ -$ 11,400$ 99,900
21Misael Atkinson0%0%0%27%0%73%0%$ -$ -$ -$ 20,100$ -$ 93,900$ -
22Drew Pierce0%0%39%0%0%61%0%$ -$ -$ 80,700$ -$ -$ 27,500$ -
Sheet1
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this

Excel Formula:
=PROMEDIO(SI(B3:H3>0,J3:P3,0)*($J$1:$P$1))
 
Upvote 0
Like this?
Book1
BCDEFGHIJKLMNOPQR
132%200%200%60%110%100%82%
2NameAppleBananaPearBlueberryApricotCherryGrapeAppleBananaPearBlueberryApricotCherryGrapeWeighted Average
3Cillian Thornton0%36%64%0%0%0%0%$ -$ -$ 43,900.00$ -$ -$ -$ -21,950.00
4Luciano Atkinson0%0%0%41%0%59%0%$ -$ -$ -$ 72,200.00$ -$ 49,100.00$ -57,762.50
5Kiaan Brooks0%0%0%0%85%15%0%$ -$ -$ -$ -$ 85,000.00$ -$ -44,523.81
6Mack Ford0%0%89%0%11%0%0%$ -$ -$ -$ -$ -$ -$ --
7Augustus Williams0%0%0%0%0%55%45%$ -$ -$ -$ -$ -$ 86,400.00$ 84,200.0085,408.79
8Dax Robinson0%17%0%0%0%83%0%$ -$ 79,200.00$ -$ -$ -$ -$ -52,800.00
9Elliot Page46%54%0%0%0%0%0%$ 70,100.00$ -$ -$ -$ -$ -$ -9,668.97
10Noel Peterson0%0%0%0%0%75%25%$ -$ -$ -$ -$ -$ 81,000.00$ 39,600.0062,347.25
11Clyde Valdez0%0%15%0%0%85%0%$ -$ -$ 90,700.00$ -$ -$ 94,400.00$ -91,933.33
12Leonidas Adkins0%26%0%74%0%0%0%$ -$ 14,600.00$ -$ 69,100.00$ -$ -$ -27,176.92
13Titus Silva93%0%7%0%0%0%0%$ 13,600.00$ -$ 14,500.00$ -$ -$ -$ -14,375.86
14Killian Barnett86%0%0%14%0%0%0%$ 77,300.00$ -$ -$ 87,600.00$ -$ -$ -84,017.39
15Andres Miles77%0%23%0%0%0%0%$ 52,600.00$ -$ 26,300.00$ -$ -$ -$ -29,927.59
16Cairo Moody0%0%79%0%0%21%0%$ -$ -$ -$ -$ -$ 35,100.00$ -11,700.00
17Yahir Frazier0%0%0%89%0%11%0%$ -$ -$ -$ 27,200.00$ -$ 29,100.00$ -28,387.50
18Sonny Nelson0%0%29%0%0%0%71%$ -$ -$ 80,900.00$ -$ -$ -$ 29,000.0065,808.51
19Collin Curtis0%34%66%0%0%0%0%$ -$ 11,300.00$ 91,300.00$ -$ -$ -$ -51,300.00
20Truett Fisher0%0%0%0%0%57%43%$ -$ -$ -$ -$ -$ 11,400.00$ 99,900.0051,273.63
21Misael Atkinson0%0%0%27%0%73%0%$ -$ -$ -$ 20,100.00$ -$ 93,900.00$ -66,225.00
22Drew Pierce0%0%39%0%0%61%0%$ -$ -$ 80,700.00$ -$ -$ 27,500.00$ -62,966.67
Sheet1
Cell Formulas
RangeFormula
R3:R22R3=SUMPRODUCT(--($C3:$I3<>0),$K3:$Q3,$K$1:$Q$1)/SUMIF($C3:$I3,"<>0",$K$1:$Q$1)
 
Upvote 0
Solution
Like this?
Book1
BCDEFGHIJKLMNOPQR
132%200%200%60%110%100%82%
2NameAppleBananaPearBlueberryApricotCherryGrapeAppleBananaPearBlueberryApricotCherryGrapeWeighted Average
3Cillian Thornton0%36%64%0%0%0%0%$ -$ -$ 43,900.00$ -$ -$ -$ -21,950.00
4Luciano Atkinson0%0%0%41%0%59%0%$ -$ -$ -$ 72,200.00$ -$ 49,100.00$ -57,762.50
5Kiaan Brooks0%0%0%0%85%15%0%$ -$ -$ -$ -$ 85,000.00$ -$ -44,523.81
6Mack Ford0%0%89%0%11%0%0%$ -$ -$ -$ -$ -$ -$ --
7Augustus Williams0%0%0%0%0%55%45%$ -$ -$ -$ -$ -$ 86,400.00$ 84,200.0085,408.79
8Dax Robinson0%17%0%0%0%83%0%$ -$ 79,200.00$ -$ -$ -$ -$ -52,800.00
9Elliot Page46%54%0%0%0%0%0%$ 70,100.00$ -$ -$ -$ -$ -$ -9,668.97
10Noel Peterson0%0%0%0%0%75%25%$ -$ -$ -$ -$ -$ 81,000.00$ 39,600.0062,347.25
11Clyde Valdez0%0%15%0%0%85%0%$ -$ -$ 90,700.00$ -$ -$ 94,400.00$ -91,933.33
12Leonidas Adkins0%26%0%74%0%0%0%$ -$ 14,600.00$ -$ 69,100.00$ -$ -$ -27,176.92
13Titus Silva93%0%7%0%0%0%0%$ 13,600.00$ -$ 14,500.00$ -$ -$ -$ -14,375.86
14Killian Barnett86%0%0%14%0%0%0%$ 77,300.00$ -$ -$ 87,600.00$ -$ -$ -84,017.39
15Andres Miles77%0%23%0%0%0%0%$ 52,600.00$ -$ 26,300.00$ -$ -$ -$ -29,927.59
16Cairo Moody0%0%79%0%0%21%0%$ -$ -$ -$ -$ -$ 35,100.00$ -11,700.00
17Yahir Frazier0%0%0%89%0%11%0%$ -$ -$ -$ 27,200.00$ -$ 29,100.00$ -28,387.50
18Sonny Nelson0%0%29%0%0%0%71%$ -$ -$ 80,900.00$ -$ -$ -$ 29,000.0065,808.51
19Collin Curtis0%34%66%0%0%0%0%$ -$ 11,300.00$ 91,300.00$ -$ -$ -$ -51,300.00
20Truett Fisher0%0%0%0%0%57%43%$ -$ -$ -$ -$ -$ 11,400.00$ 99,900.0051,273.63
21Misael Atkinson0%0%0%27%0%73%0%$ -$ -$ -$ 20,100.00$ -$ 93,900.00$ -66,225.00
22Drew Pierce0%0%39%0%0%61%0%$ -$ -$ 80,700.00$ -$ -$ 27,500.00$ -62,966.67
Sheet1
Cell Formulas
RangeFormula
R3:R22R3=SUMPRODUCT(--($C3:$I3<>0),$K3:$Q3,$K$1:$Q$1)/SUMIF($C3:$I3,"<>0",$K$1:$Q$1)

I got this one working - thank you so much!
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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