Excel functions / Logical

AND, OR, NOT & XOR

Combine or reverse TRUE/FALSE tests.

Syntax=AND(test1, test2, ...) =OR(test1, test2, ...) =NOT(test) =XOR(test1, test2, ...)

Arguments

test1, test2, ...Comparisons that are TRUE or FALSE.

How it works

AND is TRUE only when every test is TRUE. OR is TRUE when at least one is. NOT flips TRUE to FALSE and back. XOR is TRUE when exactly one of two tests is TRUE.

On their own they return TRUE or FALSE. Put them inside IF to turn that into a result: =IF(AND(B2>=50,C2="Yes"),"Credit","None").

Example

E2=AND(B2>=50,C2="Yes")
ABCDE
1StudentScoreAttended
2Ana72YesTRUE
3Ben45Yes
4Cal88No
5

Result: TRUE. Ana passed and attended, so both tests are TRUE.

Tips

Practise AND, OR, NOT & XOR

Try it yourself in a real spreadsheet, with instant feedback on every answer.

Start the exercise

Related