IF
IF(logical_test, value_if_true, value_if_false)
The test is a comparison or an AND, OR, or NOT call. Text results go in quotes. If you omit value_if_false, a failed test returns FALSE.
IF returns one value when a test is true and another when it is false. AND is true only when every argument is true, so IF(AND(score>=70, region="East"), "Bonus", "No") pays the bonus only to an East score of at least 70. OR is true when any argument is true. Put AND or OR in the test position of IF. They are not a substitute for IFS when you have several different results.
IF(logical_test, value_if_true, value_if_false)
The test is a comparison or an AND, OR, or NOT call. Text results go in quotes. If you omit value_if_false, a failed test returns FALSE.
AND(logical1, [logical2], ...)
TRUE only when every argument is TRUE. A single FALSE makes the whole AND false. Use it inside IF when a row must pass a list of tests.
OR(logical1, [logical2], ...)
TRUE when at least one argument is TRUE. Use it when several values are acceptable, such as East or West.
| Question | IF | AND inside IF | OR inside IF |
|---|---|---|---|
| Question it answers | One test, two possible results | Did every test pass? | Did at least one test pass? |
| Score at least 70 | Pass or Fail | Not enough if region also matters | Too loose if region also matters |
| Score at least 70 and East | Needs AND in the test | The right combination | Would also pay West |
| East or West | Needs OR, or two IFs | Would require both regions at once | The right combination |
| Versions | All current Excel and Google Sheets | All current Excel and Google Sheets | All current Excel and Google Sheets |
82 in the East qualifies. 64 in the West does not, because the score is under 70 even though OR would have accepted the region. 91 in the East passes the score test alone.
| Row | A | B |
|---|---|---|
| 1 | Score | Region |
| 2 | 82 | East |
| 3 | 64 | West |
| 4 | 91 | East |
| 5 | 49 | North |
=IF(A2>=70,"Pass","Fail") → Pass=IF(A3>=70,"Pass","Fail") → Fail=IF(AND(A2>=70,B2="East"),"Bonus","No") → Bonus=IF(AND(A3>=70,B3="West"),"Bonus","No") → No=IF(OR(B3="East",B3="West"),"Yes","No") → Yes=IF(OR(B5="East",B5="West"),"Yes","No") → NoThe plain IF only looks at the score, so 82 passes and 64 fails. AND adds the region. Row 2 is both at least 70 and East, so the bonus is paid. Row 3 fails the score test, so AND is false and the result is No. OR on the region ignores the score: West is one of the accepted regions, North is not.
Pass or fail, over quota or not, late or on time. The free pass-or-fail drill is this formula. Add AND or OR only when a second fact changes the answer.
Eligible and in the East region. Paid and shipped. Every test is required. One failure returns the false branch.
East or West, cash or card. Do not use AND for a list of acceptable labels. AND of two different region tests is never true.
Excel does not accept AND as a word between comparisons. The function call has to wrap them: IF(AND(A2>=70, B2="East"), "Bonus", "No").
OR(B2="East", B2="West") repeats the cell on purpose, once per acceptable value. AND(B2="East", B2="West") asks one cell to be both names and is always false.
"Bonus" is text. Bonus without quotes is a name Excel tries to resolve, which becomes #NAME? if no such name exists.
AND and OR still produce one true branch and one false branch. Three different letter grades are nested IF or IFS, not a deeper AND.
IF, AND, and OR are in every Excel version you are likely to open, and in Google Sheets. The formulas on this page do not need Microsoft 365.
IFS, which handles several different results without nesting, needs Excel 2019 or later, Microsoft 365, or Google Sheets. The nested-IF and IFS pages cover that choice.
Comparisons are not case-sensitive for text. "East" and "east" match.
Free drills are open with no account. Premium drills show the problem to everyone and grade the sheet for subscribers.
Yes. In a cell of their own they return TRUE or FALSE. Inside IF they become the test that picks between two results. A drill usually wants the IF, because the graded cell is a label such as Bonus or Pass.
Combine them: IF(AND(A2>=70, OR(B2="East", B2="West")), "Bonus", "No"). The OR is one argument of the AND. The score test is the other.
IF returns FALSE when the test fails. That is a poor label on a report. Type the third argument.
A blank compared with >=70 is not true. AND including that comparison is false. Do not rely on a blank to mean zero unless you have decided that on purpose and tested it.