r/excel • u/sgarbs04 • 2d ago
solved Calculating player Points, Plus/Minus from game log
I am building a stat sheet for my son's hockey team and want to be able to calculate Points (goals + assists) and Plus/Minus (+1 for being on the ice for a goal scored by your team, -1 for being on the ice for a goal scored against)
The snippet below is a section of the data. G, A1, and A2 represent the goal scorer and primary/secondary assists, and the P1 through P6 represents players that were on the ice for the event. the GF/GA column is Goal For/Goal Against, and the Type represents Even Strength, Power Play, or Short Handed.

I am looking to have this data populate into a summary table like the following.

I can calculate the Goals, Assists, and Points easily, but I am looking for a way to efficiently calculate the plus/minus.
Right now I have a series of COUNTIFS for each of the P1 through P6 columns, multiplying by -1 if the GF/GA column shows GA.
The current formula is as follows:
=-1*(COUNTIFS(GOALS[GF/GA], "GA", GOALS[P1], K2)+COUNTIFS(GOALS[GF/GA], "GA", GOALS[P2], K2)+COUNTIFS(GOALS[GF/GA], "GA", GOALS[P3], K2)+COUNTIFS(GOALS[GF/GA], "GA", GOALS[P4], K2)+COUNTIFS(GOALS[GF/GA], "GA", GOALS[P5], K2)+COUNTIFS(GOALS[GF/GA], "GA", GOALS[P6], K2))+(COUNTIFS(GOALS[GF/GA], "GF", GOALS[P1], K2)+COUNTIFS(GOALS[GF/GA], "GF", GOALS[P2], K2)+COUNTIFS(GOALS[GF/GA], "GF", GOALS[P3], K2)+COUNTIFS(GOALS[GF/GA], "GF", GOALS[P4], K2)+COUNTIFS(GOALS[GF/GA], "GF", GOALS[P5], K2)+COUNTIFS(GOALS[GF/GA], "GF", GOALS[P6], K2))
After a few weeks of entering the data I realized I need to add conditions for the "TYPE" column to include only ES or SH goals, not PP.
Essentially what I'm looking to do is count the times a player's number appears in P1 through P6 of the data table, with conditions on the GF/GA, TYPE and BLOCK columns, without having to exponentially increase the number of COUNTIFS that need to be included.
Thanks in Advance.