First: fill in the result column
Open your Match Data tab. Column H has the header result but is empty. Your first task is to fill it using a formula that calculates the match result automatically.
Why: the formulas you write later need to count wins, draws, and losses. Calculating the result once as a simple word is much cleaner than comparing score columns inside every formula.
In a football match, the home team wins when...
Introducing IF
IF checks a condition and returns a different value depending on whether it is true or false.
=IF(condition, value_if_true, value_if_false)
Worked example — student grades
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Score | Formula | Result |
| 2 | Alice | 72 | =IF(B2>50,"Pass","Fail") | Pass |
| 3 | Bob | 43 | =IF(B3>50,"Pass","Fail") | Fail |
| 4 | Carlos | 91 | =IF(B4>50,"Pass","Fail") | Pass |
Column H: Result — your first formula
Go to the Match Data tab in your spreadsheet (not My Analysis).
You are going to write your very first spreadsheet formula. Take it one step at a time.
What do you want to display? For each match row, you want the cell in column H to show one of three words:
home_win— if the home team scored more goalsaway_win— if the away team scored more goalsdraw— if both teams scored the same
The logic:
If home_score > away_score → "home_win" If home_score < away_score → "away_win" If they are equal → "draw"
Introducing nested IF: when you have three possible outcomes instead of two, you put a second IF inside the first. It works like this:
=IF(first condition, "value if true", IF(second condition, "value if true", "value if both false"))
For cell H2 (the first empty result cell — row 1 is the header), the formula is:
=IF(D2>E2, "home_win", IF(D2<E2, "away_win", "draw"))
D2 is home_score. E2 is away_score. If D2 is greater than E2 → home_win. If D2 is less → away_win. If neither → draw.
- Click on cell H2 in your Match Data tab
- Type the formula exactly as shown above
- Press Enter — H2 should display
home_win,away_win, ordraw
How to drag the formula down: You have 300+ rows to fill. You don't type the formula 300 times — you drag it.
- Click on H2
- Look at the bottom-right corner of the cell — you'll see a small square called the fill handle
- Hover over it until the cursor becomes a thin
+cross - Click and drag that cross all the way down to the last row of your data (drag from H2 down)
- Release — Google Sheets fills every row automatically, adjusting the row numbers (H3, H4, H5…) for you
Mac shortcut: click H2, then hold Shift and click the last cell in column H, release, then press Cmd+Enter — this fills the selection with the formula instantly.
This is one of the most useful techniques in spreadsheets: write one formula, apply it to thousands of rows instantly.
Look at cell H24 in your Match Data tab — the Copa America match Argentina vs Paraguay. What does it show?

