IF: choosing a result

Managers who sold $100,000 or more get a bonus. The comparison =B2>=100000 can check that, but it answers TRUE or FALSE. That's unclear to whoever reads the bonus table: does FALSE next to a manager mean "no bonus", or that the formula broke? A report reads better with plain words, "Bonus" or "No".

The IF function puts words in place of TRUE and FALSE. It checks a condition and chooses which of two answers to show:

=IF(B2>=100000,"Bonus","No")

It reads like a sentence: if B2 is greater than or equal to 100,000, then "Bonus", otherwise "No".

fx
A
B
C
D
E
1
2
3
4
5
6
7
8
Manager
Sales, $
Target met
Bonus
Emma
124000
Ben
87500
Olivia
100000
Leo
99900
Mia
143000
Sheet1

The fork

Inside the parentheses of IF there are three arguments separated by commas. The first one asks the question, the second holds the answer for "yes", and the third the answer for "no". In the diagram, each argument has its own color. Pick Ben: his sales fall short of the threshold, so the third argument goes into the cell.

=IF(B2>=100000,"Bonus","No")
First argument: the condition124,000>= 100,000?TRUE
Second argument: if true"Bonus"
Third argument: if false"No"
For Emma, the condition is true, so the cell gets the second argument: Bonus.

Words in quotes, numbers without

Words that IF should show are written in quotes: "Bonus". Numbers, cell addresses and calculations are written without quotes, and then the answer stays a number you can add up.

This way you can calculate the bonus in dollars right away: 5% of sales for those who met the target, and 0 for everyone else. In a formula, five percent is written as the decimal 0.05:

=IF(B2>=100000,B2*0.05,0)
fx
A
B
C
D
1
2
3
4
5
6
7
8
9
Manager
Sales, $
Bonus, $
Emma
124000
Ben
87500
Olivia
100000
Leo
99900
Mia
143000
Total
Sheet1

An empty cell instead of "No"

Sometimes the report doesn't need any word in place of "No". Then the third argument is two quotes in a row: that's empty text, and the cell looks empty.

=IF(B2>=100000,"Bonus","")

For those who didn't meet the target, the cell stays empty, and only the bonuses catch the eye.