AND, OR, and NOT are Excel’s logical functions, and each one returns TRUE or FALSE. AND(logical1, [logical2], ...) is TRUE only when every condition is TRUE; OR(logical1, [logical2], ...) is TRUE when at least one condition is; and NOT(logical) flips a single result, turning TRUE into FALSE and FALSE into TRUE. On their own they just report TRUE or FALSE, so the usual move is to drop one into an IF as the logical test, the first argument that decides which branch runs: =IF(AND(B2>=90, C2>=90), "Pass", "Review") marks a row Pass only when both scores reach 90.
How IF itself works, how to nest several IFs, and when the flatter IFS reads more cleanly all live in the IF function guide. Here the IF is only the wrapper that turns the TRUE or FALSE from AND, OR, or NOT into the result you actually want.
What do AND, OR, and NOT do on their own?
Each function takes conditions and boils them down to a single TRUE or FALSE.
- AND returns TRUE only if all of its conditions are TRUE, and FALSE as soon as one of them fails.
AND(logical1, [logical2], ...)accepts up to 255 conditions. - OR returns TRUE if any one of its conditions is TRUE, and FALSE only when every one fails.
OR(logical1, [logical2], ...)also accepts up to 255 conditions. - NOT takes a single condition and reverses it.
NOT(logical)turns a TRUE into FALSE and a FALSE into TRUE, and it takes exactly one condition, not a list.
Each condition is normally a comparison built from an operator such as >, <, >=, or <>; the whole set of them is in formula symbols. The arguments do have to resolve to logical values. Point AND or OR at a range that holds no TRUE or FALSE values and you get a #VALUE! error, though text and blank cells sitting inside a referenced range are skipped rather than counted.
A related use: these three also work as the formula behind a conditional formatting rule, where you drop the IF and let AND, OR, or NOT decide on its own whether a cell gets formatted.
How do I put AND inside an IF?
The AND function goes in IF’s first slot, the logical test. IF then returns its true branch only when AND comes back TRUE. Here two exam scores decide a Pass or a Review, and both scores have to clear the bar:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Written | Practical | Result |
| 2 | Ada | 95 | 92 | Pass |
| 3 | Bo | 88 | 96 | Review |
| 4 | Cy | 90 | 90 | Pass |
Read the formula from the inside out. AND(B2>=90, C2>=90) resolves to TRUE or FALSE first, and only then does IF pick a branch from it. Notice the closing parenthesis right after the two conditions: the AND ends there, and "Pass" and "Review" are IF’s second and third arguments, not part of the AND. That layout is the same whichever of the three functions you use.
AND and OR both accept up to 255 conditions, but stacking more than a handful makes a formula hard to build, test, and maintain, so keep the list short.
How do OR and NOT fit the same slot?
OR sits in exactly the same position as AND. The only thing that changes is what makes it TRUE: any single condition passing is enough. This flags a row for Merit when either score reaches 90:
Swap OR for AND in that formula and the meaning inverts from “either score” to “both scores”, with nothing else touched.
NOT is the odd one of the three, because it takes a single condition and hands back its opposite. On its own it looks like this:
That returns FALSE when A2 is greater than 100 and TRUE otherwise. Wrap it in an IF the same way as the others when you want to act on the reversed result. NOT earns its keep for “is not this” tests: NOT(B2="Closed") is TRUE for every status that is not Closed, which is often easier to read than spelling out each of the other values.
Why can’t I write AND between two comparisons?
This is the mistake that trips people who know the logic but not the syntax. In plain English you would say “greater than 1 and less than 10”, so it is tempting to type the word AND straight into the formula. Excel does not read it that way:
The fix is to make AND do the joining. Put both comparisons inside the function, separated by a comma, and the function returns the one TRUE or FALSE that IF needs. The same holds for OR: it is OR(A2>1, A2<10), never A2>1 OR A2<10.
The short version
- AND is TRUE only when every condition is TRUE; OR is TRUE when at least one is; NOT reverses a single TRUE or FALSE.
- Their signatures are
AND(logical1, [logical2], ...),OR(logical1, [logical2], ...), andNOT(logical). AND and OR take up to 255 conditions, NOT takes exactly one. - To act on the result, put the function in IF’s first argument:
=IF(AND(B2>=90, C2>=90), "Pass", "Review"). The function closes after its conditions; the two results belong to the outer IF. - You cannot write the word AND between two comparisons.
A2>1 AND A2<10is not valid; it has to beAND(A2>1, A2<10). - The IF function covers how IF nests and when IFS is cleaner; formula symbols is the reference for the comparison operators these conditions are built from.
- Because a wrong condition returns a confident value rather than an error, compare the workbook before and after you change one, and read off which results actually moved.