Count Matching Players and Winning Teams in Excel
Question details
Count the weeks when two players were both assigned to the red team and red was also the winning team.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Player assignments and winning teams are stored across week columns, with the winner range potentially offset from the player ranges.
- Observed behavior
- The desired result is a count of weeks in which both player assignments and the corresponding winner are Red.
Identify the rows containing the two players and the winning team. Check which winner column corresponds to each player week, especially if the winner data starts in a different column.
Use COUNTIFS to Match Both Players and the Winner
Count weeks where all three corresponding cells contain Red, including cases where the winner range is offset.
On Sheet2, identify the first and last week columns for both player rows and the corresponding winner row. For the example below, player data runs from A to AA, while the matching winner data runs from B to AB.
Select an empty cell and enter =COUNTIFS(Sheet2!A$3:AA$3,"Red",Sheet2!A4:AA4,"Red",Sheet2!B$30:AB$30,"Red"). Press Enter to return the count.
Replace the sheet name, row numbers, and column endpoints with those in your workbook. Keep all three ranges the same size, and make sure their first cells represent the same week.

Count Matching Player and Winner Weeks in WPS Spreadsheet
Open your workbook in WPS Spreadsheet and use COUNTIFS to compare both player rows with the corresponding winning-team row.
- 1. Open the workbook: In WPS Spreadsheet, select Open and choose your Excel workbook.
- 2. Check matching weeks: Open Sheet2 and identify the two player rows and the winner row. Confirm which columns represent the same weeks.
- 3. Enter COUNTIFS: Select an empty cell and enter =COUNTIFS(Sheet2!A$3:AA$3,"Red",Sheet2!A4:AA4,"Red",Sheet2!B$30:AB$30,"Red"). Adjust the ranges to match your workbook and press Enter.
- 4. Review the result: Compare the count with a few week columns on Sheet2 to confirm that the winner range is aligned with the player ranges.

Frequently Asked Questions
Why must the COUNTIFS ranges be the same size?
COUNTIFS compares corresponding positions in each range, so each range must have the same number of rows and columns. Check the start and end columns in the formula if Excel reports an error.
How do I count a different winning team?
Replace each "Red" criterion in the formula with the team name you want to count, such as "Blue". All three criteria should match if both players and the winner must be on that team.
What if the winning team is in the same week columns as the players?
Use the same column span for the winner range. For example, replace Sheet2!B$30:AB$30 with Sheet2!A$30:AA$30 when the winner data aligns with player columns A through AA.
Can the formula use a team name from a cell?
Yes. Enter the team name in a cell, such as C1, and replace each "Red" criterion with $C$1. Changing C1 will then change the team being counted.




