From Excel to Python
You have just built four metrics using COUNTIF, COUNTIFS, SUMIFS, and VLOOKUP in Google Sheets. Excel and Google Sheets are powerful tools for structured data work — great for building tables, exploring data visually, and applying formulas column by column.
But they have limits. Formulas become hard to read at scale. Applying a scoring model across thousands of rows requires copy-pasting or complex array formulas. And collaborating on complex logic is difficult.
This is where Python comes in. Python is a programming language used by data analysts and data scientists around the world. It lets you express logic clearly, apply it to any amount of data instantly, and build models that are reproducible and easy to modify. In one line of Python, you can score all 30 countries at once.
That is exactly what you are about to do.
Reflect before you build
- In a 7-match neutral-ground tournament, is long-term Win Rate or recent Momentum a more reliable predictor?
- A team can win many matches without creating many chances. Which metric better exposes luck: Goal Difference or xG?
- Which metric do you trust the least in your data? Is there a case where one metric is clearly misleading?
- If you could only use one metric, which would you choose? What would you lose by ignoring the others?
Enter your data from the spreadsheet
Copy your completed My Analysis table from Google Sheets and paste it here:
- Open your Google Sheets file and go to the My Analysis tab
- Click on cell
A4(Spain — the first data row) - Hold Shift and click
M33to select all 30 countries - Press Ctrl+C (Windows) or Cmd+C (Mac)
- Click in the box below and press Ctrl+V
Build the Composite Score in Python
You have four metrics. Assign a weight to each and write a single formula. The platform applies it to all 30 countries instantly.
Replace each weight_X with a number between 0 and 1. The four weights must add up to 1. For example: 0.4 + 0.3 + 0.2 + 0.1 = 1.0.
Write your formula in the field below.
Why should xG carry weight in a World Cup model?
What did this model not take into account that a real analyst would include?
Pick your country
- The country your model selected
- The composite score it achieved
- The one metric that most influenced your pick and why

