If Statements - Lakelands Computing

Title
Go to content
If Statements
If statements let you add a tiny bit of "intelligence" to your spreadsheet. They work on the idea of this condition is met, then do this thing, otherwise do this other thing.  A good example is shown below. If the user answers "Cat" in cell b1 then it says "Meow" in C1, if B1 does not equal "Cat" then it says "woof"
Starting a function
Finding and Opening a Function (type what you need, hit go, choose it from the list)
The If Statement
To build an If statement

You can just type them in, but until you are 100% happy with them I would do the following:

  • Start a function

  • Find the If function (if it isn't in the list then search for it (highlighted yellow), then select it (as shown in blue)

  • Open the If Function

  • Type in the test - eg b1="Cat"  (highlighted green) , would look the the word Cat in b1. (note the " " , they tell it to look for a word - a string technically) you could also do if d4=100 - which would look for the number 100 in the cell d4

  • Type in the value if true, eg "meow" (highlighted yellow). This will show if b1 contained "Cat" (etc)

  • Type in the value if false eg "woof" (pink)  what it does if the condition is not met,  so b1 does not say "cat"

  • Press OK
There is a hand out here that goes through it in a bit more detail if you need it. You can learn about how to do more complicated if statements - nested if statements - here.
All Text copyright Lakelands Academy & Mr T Purslow 2020.
All images copyright free / creative commons unless otherwise stated.
You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
Back to content