Home > database >  How to apply NBA win percentage formula to NBA data only with Google Sheets?
How to apply NBA win percentage formula to NBA data only with Google Sheets?

Time:11-30

I am hoping to find the winning percentage for the NBA only (cell F18). Here is the formula for winning percentage: sum(wins)/(sum(losses) sum(wins)).

In the example I use below there are 4 games that have been played. 3 of these games are for the NBA, the other is for the NHL (which I do not need).

The Win/Loss for the NBA in this example is 2 Wins and 1 loss for a win percentage of 66%.

Here is a snapshot of my current Google Sheets:

Google Sheets

I am working with 3 formulas in this example:1) Total win %, 2) NBA profit 3) NBA win %.

Formula #1 and #2 are working correctly. I am having an issue applying formula #3 NBA win%, however. Any suggestions?

Here are the working formulas...

Total win % located in cell E18:

=sum(B18:B)/(sum(C18:C) sum(B18:B))

NBA profit located in cell G18:

=SUMIFS(D18:D,A18:A,"NBA")

Here is my attempt at applying the NBA win% to only the NBA data:

=SUMIFS(D18:D,A18:A,F16,sum(B18:B)/(sum(C18:C) sum(B18:B)))

Here is the error that I received:

#Error! (Formula parse error)

I have browsed Stack and Google and unable to find something that applies to this specific situation. Any help would be greatly appreciated. Thanks in advance for any value that you may offer.

Note: I am trying to apply the NBA win % to cell F18. Also, the NBA win % formula and Total win % are the same. The only difference is The NBA win % output should include NBA win % data only(not NHL).

CodePudding user response:

Alternate Answer: You may use SUMIF() function.

You may use the following function:

=SUMIF(A3:A6,"NBA",B3:B6)/(SUMIF(A3:A6,"NBA",B3:B6) SUMIF(A3:A6,"NBA",C3:C6))

Result:

Note: You need to format the output to display % value.

enter image description here

Reference:

CodePudding user response:

Named Ranges

Name Range                                                                                                                                            
league A:A
win B:B
winloss B:C

Basic Math

wins divided by (wins and losses)

SUMIFS

=SUMIFS(win, league, "NBA") / SUMIFS(winloss, league, "NBA")

SUMIF

=SUMIF(league, "NBA", win) / SUMIF(league, "NBA", winloss)

SUM

=SUM(FILTER(win, league="NBA") / SUM(winloss, league="NBA")
  • Related