I am familiar with the =AVERAGE.WEIGHTED
function in Google Sheets, but I'm wondering if there's a way to add an IF in there, like =AVERAGEIF
. I have a baseball spreadsheet, with the following columns:
Column A - Player Name, Column B - Team, Column C - Innings Played, Column D - Batting Average
Basically, I want a weighted average of batting averages of all players on certain team, using innings played as the weights. If I used =AVERAGE.WEIGHTED(D:D, C:C)
, I would get a nice weighted average of all batting averages with innings played as the weights, but I only want to include players who have a Team of Yankees. How could I go about this?
Thanks in advance!