COUNTIF With Multiple Criteria From Different Ranges

NTLKnight

New Member
Joined
Oct 13, 2023
Messages
4
Office Version
  1. 2021
Platform
  1. Windows
I am trying to calculate how many "WINS" a player has against how many "GAMES" they played. Figuring out how to calculate how many "GAMES" they played was relatively easy, I used this formula:
Excel Formula:
=COUNTIF({$K$3:$K$10,$K$12:$K$19,$R$3:$R$10,$R$12:$R$19,$Y$3:$Y$10,$Y$12:$Y$19,$AF$3:$AF$10,$AF$12:$AF$19,$AM$3:$AM$10,$AM$12:$AM$19},C3)
Here is a picture to help make sense of what I am doing...
Link to the image of my spreadsheet since the image file was too big to attach in this post)

I've been trying for 3 days, but I have not been able to figure out how to calculate the "WINS" part. I am using COUNTIFS for multiple criteria, but it only works when the name of the player is 1st on the list of the range (of 4 players). Unless the name is the first in the list of 4, it won't calculate a win. Here is the formula I am working with:
Excel Formula:
=COUNTIFS($K$3:$K$6,$C$3,$O$3:$O$6,1)+COUNTIFS($K$7:$K$10,$C$3,$O$7:$O$10,1)+COUNTIFS($K$12:$K$15,$C$3,$O$12:$O$15,1)+COUNTIFS($K$16:$K$19,$C$3,$O$16:$O$19,1)+COUNTIFS($R$3:$R$6,$C$3,$V$3:$V$6,1)+COUNTIFS($R$7:$R$10,$C$3,$V$7:$V$10,1)+COUNTIFS($R$12:$R$15,$C$3,$V$12:$V$15,1)+COUNTIFS($R$16:$R$19,$C$3,$V$16:$V$19,1)+
This formula works fine if the first name in the range coincides with the cell it is pointing to for the name, but if the name is the 2nd, 3rd, or 4th in the list...it returns a 0.

Please help!

Thank you,
Nathan
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Most of us avoid merged cells like the plague. Someone might be able to come up with a better solutions but in the meantime how about something like this.
You are already using a helper column eg O, V etc. It looks like you also have merged cells in that.
What about unmerging those cells and putting in a formula to carry the 1 and 0s down and then using a Sumifs ?
I have only done the first 2 sumifs as an example below.

20240408 Countifs Win Loss Grid NTLKnight.xlsx
KLMNOPQRSTUVW
1
2GAME 1W/LHelperGAME 1W/LHelper
3NathanLOSS0NathanWIN1
4Kurt0Kurt1
5Rick0Rick1
6Noah0Noah1
7NeetinWIN1NeetinLOSS0
8Joe1Joe0
9Tania1Tania0
10Alex1Alex0
11GAME 1W/LGAME 1W/L
12NeetinWIN1NathanWIN1
13Kurt1Kurt1
14Rick1Rick1
15Noah1Noah1
16NeetinLOSS0NeetinLOSS0
17Joe0Joe0
18Tania0Tania0
19Alex0Alex0
20
21NamePlayedWinsRatio
22Nathan2
23Rick3
Sheet1
Cell Formulas
RangeFormula
O3:O10,V12:V19,O12:O19,V3:V10O3=IF(N3="W/L","",IF(N3="",O2,IF(N3="WIN",1,0)))
T22:T23T22=SUMIFS($O$3:$O$19,$K$3:$K$19,$R22)+SUMIFS($V$3:$V$19,$R$3:$R$19,$R22)
 
Upvote 1
Solution
Wow, Alex!--thank you so much!--it worked like a charm!

After setting up the whole leaderboard with your new formula ideas, I'm a bit stuck now on getting the final section of the leaderboard to auto-sort (or order) the winners. Any chance you can help me with a suggestion on this?

Here's a picture of the leaderboard, to give you a visual:
Leaderboard Image

There are 2 things I'm trying to do:
1. Auto sort the "Win Ratio" metric (in the case of my spreadsheet, the numbers in column AX (which now can borrow their values from the U column). (The "Games Played", "Wins", "Player Name/Picture" would follow.)
2. Put players at the bottom of the leaderboard who played less than 5 games (regardless of their "Win Ratio"...though if there are more than 1 players who played less than 5 games, it would be nice to have them sorted by their Win Ratio...even though at the bottom of the leaderboard...though this is not necessary).

Thank you again for your time!--I really appreciate it!

Nathan
 
Upvote 0
That is a very different question to the original post. Please create a new thread for that.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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