Intermediate
60 mins
Teacher/Student led
+65 XP

Logical Formulas: IF

You will discover how the IF formula lets a spreadsheet make decisions. By checking if costs exceed a threshold you set, your project budget will automatically flag items that are over budget using a simple three-part pattern.

Teacher Class Feed

Load previous activity

    1 - Introduction ~5 mins

    Welcome

    Illustration for IntroductionYour project budget already adds, averages, and ranks numbers. Today you give the sheet a decision: it will flag any cost that crosses a line you set. That is what an IF formula does, and it is the same pattern used in real budgets, stock lists, and Work Experience trackers.

    By the end of this lesson, you will be able to:

    • Explain the IF pattern: condition, value if true, value if false
    • Write a simple IF that flags items over a threshold
    • Adapt a worked IF pattern to your own project data
    • Add a Flag column to {{code:05_project_budget}} that shows a short label such as Over budget when a cost is above your threshold

    Missing file? If you do not yet have {{code:05_project_budget}} in the {{code:05_budget}} folder inside {{code:Project_Portfolio}}, tell your teacher now. Create a new spreadsheet named {{code:05_project_budget}} with columns Item, Category, and Cost (€), type five real Something Real costs (numbers only in Cost), and save it in that folder before the practice step.

    Warm-up

    Think of one cost in your Something Real project that would make you stop and rethink if it went too high. What number would that be: €20, €50, €100? Keep that threshold in mind. You will use a number like it in your Flag column later.

    2 - Key Concepts ~7 mins

    Read the plain-English sentence, study Aoife's result table, then skim the three concept rows. You will rebuild this sample in the next step.

    Worked sample (Aoife's phone-case side hustle)

    Key point

    In plain English: If the cost is greater than 40, write Over budget, otherwise leave it blank.

    Aoife sells custom phone cases at a local market. She wants any single cost over €40 flagged. After the IF is filled down, the Flag column should look like this:

    ItemCategoryCost (€)Flag
    Blank cases (50)Materials85Over budget
    Vinyl stickersMaterials18
    Heat-press hireEquipment60Over budget
    Instagram adsMarketing25
    Packaging bagsMaterials12
    Example

    The formula in the first Flag cell is {{code:=IF(C2>40,"Over budget","")}}. The same pattern, with your own threshold and your own column letters, is what you will add to {{code:05_project_budget}}.

    ConceptWhy it mattersExample
    IF formula — a three-part decision: condition, value if true, value if falseYour budget can mark problem costs automatically instead of you scanning every row by eyeFlag any Work Experience travel cost over €30 so the overspend is visible before you print the sheet
    Condition and threshold — the test the formula runs first, using the number that triggers the flag (for example {{code:C2>40}})If the test or the threshold is wrong, every flag will be wrong even when the rest of the formula is perfectCost greater than 40 on a materials row costing €85 uses {{code:C2>40}}; pick a real project limit, not a random figure
    Value if true / value if false — the two answers the formula can return; any words must sit inside double quotation marksYou choose the short wording your reader will see; without quotes the sheet may show {{code:#NAME?}} or {{code:#VALUE!}}True returns {{code:"Over budget"}}; false returns a blank {{code:""}} so clean rows stay quiet

    Quick check

    Before you type, pair the IF workflow pieces on the matching worksheet with your neighbour. Check you agree on condition, true label, false blank, and the closing bracket.

    3 - Step-by-step Task ~14 mins

    Build Aoife's five-row sample on a practice sheet, write one IF, fill it down, test that a flag clears when you lower a cost, and check the flags match the worked sample. Use the tabs below for Excel for the web or Google Sheets.

    Note

    If {{code:05_project_budget}} is missing: tell your teacher and use a blank workbook named {{code:05_project_budget}} with a short five-row cost list (Item, Category, Cost (€)) before you add the {{code:IF_practice}} sheet. Save it in the {{code:05_budget}} folder inside {{code:Project_Portfolio}}.

    4 - Common Issues ~4 mins

    Common Issues

    First IF attempts often show an error. That is normal. Use the table, then study the short adapt example before you touch your real budget.

    IssueSolution
    I see {{code:#NAME?}} or {{code:#VALUE!}} in the Flag cellCheck the word {{code:IF}} is spelled correctly, every text label sits inside double quotes ({{code:"Over budget"}}), and you used straight quotes not curly ones pasted from a message app
    Every row is blank, or every row says Over budgetClick the first Flag cell and read the condition. Confirm the column letter points at Cost, the threshold number is the one you meant, and Cost cells hold numbers rather than text such as {{code:€85}}
    Autofill copied the same flag on every rowMake sure you started from a real formula cell (not a pasted value). Delete the Flag column contents, retype the IF in the first data row, then drag the fill handle again
    My real budget columns are not A–C like the sampleThat is fine. Change the letter in the condition to match your Cost column (for example {{code:E2}} if Cost is in column E). The pattern stays the same

    Adapt the pattern

    The sample used Cost in column C, first data row 2, threshold 40. Your sheet may differ. Watch this 20-second swap before you type on your own budget:

    Example

    If Cost is in column E, the first item row is 3, and your threshold is 50, the first Flag formula is:

    {{code:=IF(E3>50,"Over budget","")}}

    Key point

    Write your Cost column letter, first data row, and threshold on a sticky note before you type on the real budget sheet. Do not copy C and 40 unless those really match your sheet.

    5 - Your Turn on the Real Budget ~20 mins

    Independent Practice

    Your goal: Give {{code:05_project_budget}} a Flag column that automatically marks costs above a threshold you choose, so overspends jump out before you rely on the sheet for a real decision.
    Time: ~20 minutes
    Task: Wait until your teacher confirms your Cost column letter and threshold, then open the main budget sheet in {{code:05_project_budget}} from the {{code:05_budget}} folder inside {{code:Project_Portfolio}} (not the {{code:IF_practice}} sheet). On a sticky note write your Cost column letter, your first data row number, and your real Something Real threshold, then add a Flag heading in the next empty column beside your costs. Type an IF in the first item row only using your sticky-note values in the pattern {{code:=IF(YourCostCell>YourNumber,"Over budget","")}}, check that one cell with your teacher, fill the formula down every item row, and change one cost on purpose so you can watch the flag appear or disappear.
    Success criteria:
    • {{code:05_project_budget}} has a clear Flag column heading next to your item costs
    • Your IF uses your own Cost column letter and threshold, not a blind copy of the sample's C and 40
    • Flags update automatically when you change a cost above or below your threshold (same live test you did on Heat-press hire)
    • Only the rows that truly break your limit show a label; the other Flag cells stay blank
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more