Function Problems

Excel Formula to Check if Two Teams Are in the Same Division

Olivia MillerOlivia Miller Nov 3, 2026 870 views

Question details

Determine whether two teams in a match (e.g., the winning and losing teams) belong to the same division using an Excel formula.

How to Check if Two Teams Are in the Same Division Using Excel Formulas
Product
Excel
Device & OS
not provided
Scenario
Comparing sports team divisions based on match results when teams are categorized into multiple divisions.
Observed behavior
The user needs a logical formula that looks up the divisions for both teams in a specific matchup and outputs a definitive Yes or No if they match.
Before you start

Ensure you have a complete master list of all teams and their respective divisions set up in your spreadsheet to serve as the reference for your lookup formulas.

Solution 1Recommended

Use VLOOKUP and IF Functions to Compare Divisions

This is the most efficient and recommended method. It uses a master lookup table to find the division for each team and compares them with an IF statement.

By nesting two VLOOKUP functions inside an IF statement, Excel will search your master team table, extract the division for both Team 1 and Team 2, and compare them. If the divisions are identical, it returns 'Yes'; otherwise, it returns 'No'.

1
Set up a Master Lookup Table

Create a lookup table in your worksheet, for example in columns F and G. List all the Team Names in column F and their corresponding Divisions in column G.

2
Enter the VLOOKUP Formula

Select the cell where you want the comparison result to appear (e.g., D2). Type the formula: =IF(VLOOKUP(B2,F:G,2,FALSE)=VLOOKUP(C2,F:G,2,FALSE),"Yes","No"). This assumes B2 and C2 contain the names of the two competing teams.

3
Apply to All Matches

Press Enter to see the result for the first match. Click the cell, grab the fill handle (the small square at the bottom-right corner), and drag it down to apply the formula to the rest of the matches in your column.

Use VLOOKUP and IF Functions to Compare Divisions
Absolute References: Using entire column references like F:G prevents the lookup table from shifting when you drag the formula down. If you use specific ranges like F2:G20, be sure to lock them with dollar signs ($F$2:$G$20).
Smart Spreadsheet Management

Use WPS Spreadsheet for Advanced Team Data Analysis

WPS Spreadsheet makes it incredibly easy to use advanced logical formulas like VLOOKUP, COUNTIF, and IF. It helps you manage complex sports schedules, data tables, and dynamic comparisons smoothly.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the match data and team division reference table.
  2. 2. Input the comparison formula: Select the empty cell next to your match data, and type =IF(VLOOKUP(B2,F:G,2,FALSE)=VLOOKUP(C2,F:G,2,FALSE),"Yes","No").
  3. 3. Execute the formula: Press Enter to instantly evaluate whether the winning and losing teams are from the same division.
  4. 4. Batch process the games: Double-click the fill handle at the bottom right corner of the selected cell to automatically fill the formula down to the bottom of your data set.
Fully compatible with Microsoft Excel formulas (.xlsx and .xls)Free to use with a familiar, easy-to-navigate tab interfaceSupports advanced lookup functions to handle massive datasetsLightweight software that runs seamlessly on Windows, Mac, and Linux
microsoft office alternative - wps office

Frequently Asked Questions

What happens if a team name is misspelled in the match list?

If a team name in your match list does not exactly match the name in your lookup table, VLOOKUP will return an #N/A error. To prevent this, ensure spelling is consistent, or use Data Validation to create drop-down lists for team selection.

Can I use XLOOKUP instead of VLOOKUP to compare teams?

Yes. If your spreadsheet software supports XLOOKUP, you can use the formula =IF(XLOOKUP(B2,F:F,G:G)=XLOOKUP(C2,F:F,G:G),"Yes","No"). XLOOKUP is generally more robust and doesn't require column index numbers.

Are VLOOKUP and COUNTIF case-sensitive?

No, standard VLOOKUP and COUNTIF functions are not case-sensitive. 'Team Alpha' and 'TEAM ALPHA' will be treated identically by the formulas.

How can I automatically highlight games where teams are in the same division?

You can use Conditional Formatting. Select your entire match data range, navigate to Conditional Formatting > New Rule, choose to use a formula, and enter =$D2="Yes" (assuming column D holds your formula results). Choose a fill color and apply.