Formula to Count number of wins between two players

sankaman

New Member
Joined
Apr 4, 2024
Messages
4
Office Version
  1. 365
Platform
  1. MacOS
I have a table in which I want to count the number of matches a certain player has won and loss. This is what I have:
1712270572230.png

What I want is a formula that returns the number of times Alex has won and lost against all other players and so on with every player.

I was thinking of COUNTIF but I can seem to get it to work.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
For Alex, wouldn't it just be the count of column B? But then you have 9 values for all players. Not clear what the W/L in your data indicates.
 
Upvote 0
Maybe this way
Excel Formula:
=SUMIF(B2:U2, "W", B3:U3)
 
Upvote 0
Maybe this way
Excel Formula:
=SUMIF(B2:U2, "W", B3:U3)
Thanks, I've tried that and the result is the sum of points scored, not the matches won. Each pl;ayer plays agains all the other players and the poins are counted, I have that on another sheet. In this instance, the number of matches won by Alex in this example is 6 and the number of matches lost is 3 for a total of 9 played matches. The difference in points (column Z is -2. (total won points vs loss points).
 
Upvote 0
How can one tell wether Alex won or lost against GodFried when you have 2 points under W and 3 under L? Does this mean Alex won by 2 points?
1712359465548.png
 
Upvote 0
I'm assuming W and L refer to points won or lost NOT the match?

So when Alex played against Godfried Alex won 3 points and Godfried won 2 with the result that Alex won the match (by 1 point).

So Alex has won 5 matches, drawn 1 and lost 3? Not 'In this instance, the number of matches won by Alex in this example is 6 and the number of matches lost is 3 for a total of 9 played matches.' you mentioned?
 
Upvote 0
If my earlier assumptions are correct, I would create a set of helpers (10 columns x 10 rows) to convert the points to whether the match was won/drawn/lost.

For example
=if(and(isnumber(b3),isnumber(c3)),sign(b3-c3),"")

so sign will return 1 for a Win, 0 for a Draw and -1 for a Loss.

You can then add up using for example COUNTIF(range,xn=1) to get the number of wins.

Again I'm making assumptions that the players are a fixed number.
 
Upvote 0
If my earlier assumptions are correct, I would create a set of helpers (10 columns x 10 rows) to convert the points to whether the match was won/drawn/lost.

For example
=if(and(isnumber(b3),isnumber(c3)),sign(b3-c3),"")

so sign will return 1 for a Win, 0 for a Draw and -1 for a Loss.

You can then add up using for example COUNTIF(range,xn=1) to get the number of wins.

Again I'm making assumptions that the players are a fixed number.
Thanks for your help.

The W or L refer to who won the match, there can't be a tie, I made a mistake there, it should be either a 3-2 in favor of Alex or 3-2 in favor of Jonathan. So each match has a winner and a loser and the sum of all the Won point are added and the total points Lost subtract to get the Point Difference. In this example, If Alex won a match against Godfried he wins one match point, and Godfried looses one match point.
 
Upvote 0
The W or L refer to who won the match, there can't be a tie, I made a mistake there, it should be either a 3-2 in favor of Alex or 3-2 in favor of Jonathan. So each match has a winner and a loser and the sum of all the Won point are added and the total points Lost subtract to get the Point Difference.
What about this then?

24 04 06.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2WLWLWLWLWLWLWLWLWLWLWLPts
3Alex32320442312143130463-2
WL
Cell Formulas
RangeFormula
X3X3=SUMPRODUCT((B3:T3>C3:U3)*(B$2:T$2="W"))
Y3Y3=COUNT(B3:U3)/2-X3
Z3Z3=SUMIF(B$2:U$2,"W",B3:U3)-SUMIF(B$2:U$2,"L",B3:U3)
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,287
Messages
6,124,075
Members
449,140
Latest member
SheetalDixit

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