← All lessons
Spreadsheets · Lesson 5 of 10

AND, OR and more than two choices

AND(test1, test2, …) is TRUE only when every test is. OR(test1, test2, …) is TRUE when at least one is. They're most useful inside IF: =IF(AND(B2>=10000,C2>=4),"Yes","No").

For more than two outcomes, put an IF in the false part of another: =IF(B2>=90,"A",IF(B2>=75,"B","C")). The spreadsheet checks from the left and stops at the first test that's true, so start with the highest band.

Newer versions (Excel 2019 and later, Google Sheets) also have IFS(test1, result1, test2, result2, …), which reads more easily than several IFs. Either works in the practice grids.

Practice

A bonus needs sales of at least 10,000 and a rating of at least 4. Show "Yes" or "No" in D2 (copied to D5).

ABCD
1NameSalesRatingBonus?
2Kim120004.5
3Lee150003.8
4Max90004.9
5Ola100004

D2

More info

Quick reference

AND(test, test, …)TRUE when all are true.
OR(test, test, …)TRUE when any is true.
NOT(test)Flips TRUE and FALSE.
IFS(test, result, …)The first result whose test is true.

The practice answers

Other formulas that give the same results count too.

  1. A bonus needs sales of at least 10,000 and a rating of at least 4. Show "Yes" or "No" in D2 (copied to D5). =IF(AND(B2>=10000,C2>=4),"Yes","No")
  2. The shop stays open late on Saturday and Sunday. Show "Late" or "Normal" in B2 (copied to B5). =IF(OR(A2="Sat",A2="Sun"),"Late","Normal")
  3. 90 and up is an A, 75 and up a B, anything else a C. Show the grade in C2 (copied to C5). =IF(B2>=90,"A",IF(B2>=75,"B","C"))

An unofficial course. Not made by or affiliated with Microsoft; Excel is a trademark of Microsoft Corporation.