Why is my Weighted Average Formula Not Working?

rob51852

Board Regular
Joined
Jun 27, 2016
Messages
190
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am trying to come up with a weighted average formula but keep getting myself tied up in knots...

I have a table called ScorecardBattingTable and here is a small excerpt:

Book1
BCDEFGHIJKLMNOPQRSTUV
1battingTeaminningsNobatsmanIdhowDismissedbowlerrunsballsFaced_4s_6sconvDateLeagueSeasonvenueGrBatAveAdjGrSRAdjGrBPercentAdjLgBatAveAdjLgSRAdjLgBPercentAdjGrAdjRunsGrAdjSRRpB
2Lahore Qalandars156194caught25955130205015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398328.21.41
3Lahore Qalandars1512191caught25172146364215/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398343.241.201111111
4Lahore Qalandars1532424caught1159371541015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.8975039834.71.175
5Lahore Qalandars141434caught4263919212015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398317.860.85047619
6Lahore Qalandars1388678bowled42639330015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.8975039832.820.94
7Lahore Qalandars118632caught4326526164015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398324.441.5275
8Lahore Qalandars1221140not out48215315/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398345.122.148571429
9Lahore Qalandars11218226not out000015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.8975039830
10Multan Sultans2520183caught11616061291115/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398311.281.253333333
11Multan Sultans2251721caught22114050294315/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.897503983471.620689655
12Multan Sultans2233901caught120662327221015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398325.381.153636364
13Multan Sultans2318845caught116160618181015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398316.920.94
14Multan Sultans210582caught221140120015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.8975039830.940.47
15Multan Sultans2716733caughtShah30192215/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398328.21.484210526
16Multan Sultans242639bowled1161606010015/11/2020Pakistan Super League2020/21National Stadium, Karachi0.940.940.930.9523809520.9834837020.89750398300
ScorecardBatting


And I am trying to produce a weighted average by batsmanId (F3) and League (A285). The range I want to average is GrAdjSRRpB and the weightings are in ballsFaced.

This is the latest attempt:

Code:
=SUMPRODUCT((ScorecardBattingTable[batsmanId]=$F$3)*(ScorecardBattingTable[League]=A285),ScorecardBattingTable[GrAdjSRRpB],ScorecardBattingTable[ballsFaced])/SUMIFS(ScorecardBattingTable[GrAdjSRRpB],ScorecardBattingTable[batsmanId],$F$3,ScorecardBattingTable[League],A285)

Can anyone see what the issue is?

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I don't think A285 is address of your Criteria cell and it is league name. Then you forgot to add "" to your text for finding. change formula to this:
Excel Formula:
=SUMPRODUCT((ScorecardBattingTable[batsmanId]=$F$3)*(ScorecardBattingTable[League]="A285"),ScorecardBattingTable[GrAdjSRRpB],ScorecardBattingTable[ballsFaced])/SUMIFS(ScorecardBattingTable[GrAdjSRRpB],ScorecardBattingTable[batsmanId],$F$3,ScorecardBattingTable[League],"A285")
 
Last edited:
Upvote 0
Thanks Maabadi. This gives me a #Div/0! error unfortunately.
 
Upvote 0
Because you don't have league name equal "A285" in your League Column Data or your F3 cell (criteria1) is Empty. with your uploaded data, I test with "Pakistan Super League" and it worked.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,513
Messages
6,125,253
Members
449,219
Latest member
daynle

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