Computer Skills
Beginner
60 mins
Teacher/Student led
+80 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Logical Formulas: IF

Learn to write IF formulas that automatically flag items against a threshold. You'll build a Flag column for your own budget so costs needing attention jump out instantly when you open the file.

Teacher Class Feed

Load previous activity

    1 - Introduction

    Welcome

    An IF formula turns a spreadsheet from a calculator into a decision-making tool. Instead of scanning every row of your project budget looking for problems, IF reads each row, asks a yes/no question, and writes the answer next to the number. Today you'll use it to add a Flag column to your own Something Real budget, so the costs that need attention jump out the moment you open the file.

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

    • Read the =IF(condition, value_if_true, value_if_false) pattern
    • Write an IF formula that flags items against a threshold
    • Explain the condition, true and false parts in your own words

    Warm-up

    You already use IF thinking every day. You check your phone battery and plug it in if it's under 20%. You check your Leap Card balance and top up if it's under €5. That same "if X, then Y, otherwise Z" pattern is exactly what an IF formula does. Think of one more example from your own life where a number triggers a decision — what's the number, and what changes when the answer is YES vs NO?

    2 - Key Concepts

    An IF formula has three ingredients. Once you can name them, you can read any IF formula out loud and write your own.

    ConceptWhy it mattersExample
    IF function — a formula written as =IF(condition, value_if_true, value_if_false) that returns one of two answers depending on a testIt lets the spreadsheet flag rows automatically instead of you eyeballing every oneIn a club fundraiser budget, =IF(B2>100,"NEEDS APPROVAL","OK") tags every expense over €100
    Condition — a comparison that is either TRUE or FALSE, e.g. B2>100 or A3="Done"This is the test IF runs; if you get the condition wrong, the whole formula gets the wrong answerB2>100 is TRUE when venue hire is €180, FALSE when printing is €45
    Comparison operators> greater than, < less than, >= at least, <= at most, = equals, <> not equalDifferent thresholds need different operators — "over 100" is > but "at least 100" is >=For a low-stock alert in a Centra stocktake, use <. For a spend-over-limit alert, use >
    Threshold — the number or value you compare against in the conditionIt's the line between "flag this" and "leave it alone" — choose it so the flags actually tell you something useful

    A short Matching worksheet in this lesson lets you check you can name each part of the formula before you write one yourself.

    3 - Step-by-step Task — Flag Expenses Over a Threshold

    You're going to build the exact IF formula you'll use on your own budget later, on a small practice spreadsheet first. The scenario: a volunteer is running expenses for a local community fundraiser and wants any cost over €100 flagged automatically as "NEEDS APPROVAL" so the committee can review it. You'll enter four sample costs, write the IF formula once, and autofill it down.

    4 - Common Issues

    When your IF formula misbehaves, it's almost always one of these four things. Check them before you ask for help.

    Common Issues

    IssueSolution
    The cell shows #NAME?Missing or curly quotes around the text results. Retype the formula using straight quotes (") from your keyboard — copy-paste from a document or webpage can sneak in curly quotes (/) that the spreadsheet doesn't recognise as text markers.
    The cell shows the formula itself as text (e.g. IF(B2>100,"NEEDS APPROVAL","OK"))You forgot the leading = sign. Click the cell, press {{key:F2}} (or double-click) to edit, add = at the start, and press {{key:Enter}}.
    Every row says "OK" even though some costs are clearly over the threshold — or every row says "NEEDS APPROVAL"You've put the TRUE and FALSE results in the wrong order, or used the wrong operator. Read the formula out loud: "if cost is greater than 100, show X, otherwise show Y." If X and Y are swapped, swap them in the formula.
    Autofill copied the formula but every cell shows the same result as C2You probably typed an absolute reference ($B$2) instead of a normal one (B2). IF needs to test each row, so the B reference must move — remove the dollar signs and autofill again.

    5 - Independent Practice — Flag Your Own Budget

    Independent Practice

    Your goal: Add a Flag column to your own Something Real budget so the costs that matter stand out automatically — and so you have something concrete to show someone when you pitch the project.
    Time: ~20 minutes
    Task: Open {{code:05_project_budget}} from your {{code:Digital_Portfolio}} folder and add a new column headed "Flag" to the right of your cost column. Pick a threshold that makes sense for your project — a spend-limit you don't want to cross, a minimum stock level, a survey-response count you need to hit — and write an IF formula in the first data row that flags rows either side of that threshold using short text labels you choose. Autofill the formula to every row of your budget and test it works by changing one number.
    Success criteria:
    • Your budget has a new Flag column that shows a short text answer on every data row
    • Your threshold makes sense for the project — you can say in one sentence why you chose that number
    • Changing a cost in your budget makes the matching Flag update on its own — try it to prove it works

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more on our learning platform.

    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