WeCodeAcademy

IF: Making Decisions

=IF(test, value_if_true, value_if_false) chooses between two results. The test is a comparison: >, <, >=, <=, = or <> (not equal). Text results go in double quotes.

In this course each line of an example is one cell: the address, a colon, then what is in the cell. A line starting with = is a formula. Press Run to see the sheet with every formula worked out.

Exampleexcel
Open in editor »
Quick check

What does `=IF(5>3,"yes","no")` give?

Your turn: write the code

Fill C2:C4 so it shows 'Bonus' when sales in B are above 1000 and 'None' otherwise.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.