Function Problems

Count How Often Two People Are on the Same Team in Excel

Elise WilliamsElise Williams Nov 18, 2026 869 views

Question details

Count the weeks when two specified people have the same team color without writing a separate COUNTIFS formula for each week.

Count How Often Two People Are on the Same Team in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Two people have team results in separate rows, with weekly results spread across columns.
Observed behavior
The desired result is one count of weeks in which both rows contain Red or both contain Blue.
Before you start

Check which rows contain the two people and whether each weekly result occupies every column or only even-numbered columns. These formulas check text values such as Red and Blue, not cell fill colors.

Solution 1Recommended

Count matches in even-numbered weekly columns

Use this formula when team results are stored in even-numbered worksheet columns, such as B, D, and F.

1
Select a result cell

Click an empty cell where you want the count to appear.

2
Enter the formula

Enter =SUMPRODUCT(ISEVEN(COLUMN(Sheet2!A:AA))*(((Sheet2!A3:AA3="Red")*(Sheet2!A4:AA4="Red"))+((Sheet2!A3:AA3="Blue")*(Sheet2!A4:AA4="Blue")))) and press Enter.

3
Adjust the references

In the formula bar, replace Sheet2, rows 3 and 4, and columns A:AA with the sheet and ranges that contain your data. Keep the two row ranges the same size.

Count matches in even-numbered weekly columns
Which columns are counted?: ISEVEN(COLUMN(...)) checks absolute worksheet column numbers. In A:AA, the formula counts B through Z at every other column; it does not count A or AA.
Count team matches in WPS

Count same-team weeks in WPS Spreadsheets

Use SUMPRODUCT in WPS Spreadsheets to count matching Red or Blue team entries across weekly columns in one formula.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to choose your Excel workbook.
  2. 2. Choose the result cell: Click an empty cell where the same-team count should appear.
  3. 3. Enter the formula: If every column represents a week, enter =SUMPRODUCT((Sheet2!A3:AA3=Sheet2!A4:AA4)*(((Sheet2!A3:AA3="Red")+(Sheet2!A3:AA3="Blue"))>0)) and press Enter.
  4. 4. Adjust and save: Edit the sheet name and row ranges in the formula bar to match your data, then select Save.
Count matching team assignments without a formula for each weekOpen and save Microsoft Excel XLSX filesWork with a familiar spreadsheet interfaceUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Can the formula count matching cell fill colors?

No. The formulas compare cell text such as Red and Blue. Enter team names in the cells, or use a separate method that reads fill colors.

How do I count another team color?

For the every-column formula, add another test inside the allowed-values expression, such as +(Sheet2!A3:AA3="Green"), before the closing parenthesis followed by >0.

What happens when I add more weekly columns?

Extend both row ranges in the formula bar to include the new columns. If you add weeks regularly, consider reorganizing the data into a table with one row per person and week.

Why are some weeks skipped by the even-column formula?

ISEVEN(COLUMN(...)) includes only even-numbered worksheet columns, such as B and D. If every column represents a week, use the every-column formula instead.