Skip to content

Decide with IF

Decisions and lookups7 min

IF checks a condition, then returns one value when it's true and another when it's false.

=IF(B2>=1000,"Bonus","No bonus")
Shows "Bonus" when the sales in B2 are 1,000 or more, and "No bonus" otherwise.

The condition compares two values with =, <> (not equal), >, <, >= or <=. Text results go in quotation marks; numbers don't.

Count what matches

To count how many cells meet a condition, use COUNTIF. The condition goes in quotation marks:

=COUNTIF(B2:B9,">500")
Counts the cells in B2:B9 that are greater than 500.

Practice

2 exercises · free with an account

Start practicing
  1. Not started

    1. Who gets a bonus

    Formula · medium

  2. Not started

    2. Count the big orders

    Formula · medium