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".
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.
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)
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.