Step 4 of 7

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

Questions to guide your thinking:
  1. In a 7-match neutral-ground tournament, is long-term Win Rate or recent Momentum a more reliable predictor?
  2. A team can win many matches without creating many chances. Which metric better exposes luck: Goal Difference or xG?
  3. Which metric do you trust the least in your data? Is there a case where one metric is clearly misleading?
  4. 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:

  1. Open your Google Sheets file and go to the My Analysis tab
  2. Click on cell A4 (Spain — the first data row)
  3. Hold Shift and click M33 to select all 30 countries
  4. Press Ctrl+C (Windows) or Cmd+C (Mac)
  5. 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.

Loading Python environment… (~10MB first time)
Quiz — answer before moving on

Why should xG carry weight in a World Cup model?

Try different weights and run again. Does the ranking match what the data told you? A robust pick appears near the top across most weight combinations. If your favorite changes every time you adjust by 10%, your model is fragile.
Quiz — answer before moving on

What did this model not take into account that a real analyst would include?

Pick your country

You are about to present to FIFA's leadership team. Commit to your pick:
  1. The country your model selected
  2. The composite score it achieved
  3. The one metric that most influenced your pick and why