Excel Intermediate Lesson 7: Logic With IFS, SWITCH, AND and OR

Excel Intermediate Lesson 7: Logic With IFS, SWITCH, AND and OR 1

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min read

📘 Excel Intermediate Course · Lesson 7 of 12

Advertisement
In this article
  1. IFS: slabs and grades
  2. SWITCH: one value, many outcomes
  3. AND, OR, NOT
  4. AND/OR when counting
  5. Common mistakes
  6. Practice

Nested IFs like =IF(K2>=10000,"A",IF(K2>=3000,"B","C")) work, but by the fourth level nobody, including you next month, can read them. Excel has cleaner tools.

IFS: slabs and grades

=IFS(K2>=10000, "A", K2>=3000, "B", TRUE, "C")

Conditions are checked in order and the first TRUE wins, so start with the strictest. The final TRUE, "C" is the “everything else” catch; without it, unmatched rows give #N/A.

SWITCH: one value, many outcomes

=SWITCH(D2, "North","N", "West","W", "South","S", "East","E", "?")

Use SWITCH when you compare one cell against exact values. Use IFS for ranges (above, below).

AND, OR, NOT

Question Formula
Big Electronics sale? =AND(H2="Electronics",K2>5000)
Needs follow-up? =OR(L2="Pending",L2="Overdue")
Not paid? =NOT(L2="Paid") or simply =L2<>"Paid"
Commission 5% above ₹10,000, else 2% =K2*IF(K2>10000,5%,2%)

AND/OR when counting

  • AND: COUNTIFS with several criteria. =COUNTIFS(H:H,"Furniture",L:L,"Paid")
  • OR: add COUNTIFs. =COUNTIF(D:D,"North")+COUNTIF(D:D,"East")
  • Not equal: "<>Paid"
💡 When slabs change every year (tax, commission), put them in a small table and use XLOOKUP(value, slab_start, rate,, -1) instead of writing the numbers into IFS.

Common mistakes

  • Wrong order in IFS: testing >=3000 before >=10000 means nobody ever gets an A.
  • AND inside COUNTIF: COUNTIF(range, AND(...)) doesn’t work; use COUNTIFS.

Practice

Download this lesson’s workbook below. Row-level tasks point to a specific row of the Sales sheet. Type your formula in the yellow column; the Check column turns green when the result matches, and the Answers sheet has a working formula for every task.

📎 Practice files for this article

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

Advertisement
✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong