Logical Functions
Master AND, OR, NOT, IFERROR, IFNA, SWITCH and XOR to build clean conditional logic in Excel.
✅ What You Will Learn
Logical functions evaluate conditions and return TRUE or FALSE — or control what happens when a condition is met or when a formula produces an error. They are the building blocks of decision logic in Excel.
AND() returns TRUE only when all its arguments are TRUE. OR() returns TRUE when at least one argument is TRUE. These two functions are almost always used inside IF() to test compound conditions rather than on their own.
IFERROR() is one of the most practically useful functions in Excel — it catches any error a formula might produce and returns a specified value instead. Every VLOOKUP, division, or text extraction that might fail should be wrapped in IFERROR() in a professional report.
📋 Loan application evaluation — multiple conditions
| Applicant | Credit Score | Income (₹) | Existing Loans | Eligible? |
|---|---|---|---|---|
| Rahul Sharma | 750 | 800000 | 1 | AND(score>700, income>500k, loans<3) |
| Priya Verma | 620 | 950000 | 0 | AND(score>700, income>500k, loans<3) |
| Amit Kumar | 780 | 420000 | 2 | AND(score>700, income>500k, loans<3) |
| Sneha Kapoor | 810 | 1200000 | 0 | AND(score>700, income>500k, loans<3) |
Syntax
Examples
📌 Key Points to Remember
- ✓AND and OR take up to 255 logical arguments — chain conditions without nesting
- ✓IFERROR catches #DIV/0!, #N/A, #REF!, #VALUE!, #NAME?, #NULL! and #NUM! — all Excel error types
- ✓IFNA only catches #N/A — use it when you want other errors (like #VALUE!) to remain visible for debugging
- ✓SWITCH is available in Excel 2019+ and Microsoft 365 — use IFS or nested IF in older versions
- ✓NOT() reverses the result: =IF(NOT(ISBLANK(A1)), "Has data", "Empty")
🏢 Real-World Application
Credit risk teams use AND() with multiple scoring criteria to auto-approve or reject loan applications. Retail analysts use IFERROR around division formulas (profit margin = profit/revenue) so that months with zero revenue show 0% instead of breaking the dashboard. SWITCH is widely used in payroll to convert department codes to department names without a lookup table.
⚠️ Common Mistakes to Avoid
❓ Frequently Asked Questions
What is the difference between IFERROR and IFNA?
IFERROR traps all Excel error types. IFNA traps only #N/A errors. Use IFNA with VLOOKUP/MATCH when you want to show "Not found" for missing lookups but still want to see #VALUE! or #REF! errors that indicate real formula problems.
Can AND and OR be used outside IF?
Yes — they return TRUE or FALSE directly. =AND(A1>0, B1>0) in a cell shows TRUE or FALSE. They are often used in Conditional Formatting formula rules and Data Validation formula rules.
What does XOR do?
XOR (exclusive OR) returns TRUE when exactly ONE of the conditions is true, not when both are true. =XOR(TRUE, TRUE) returns FALSE. It is rarely used in business analysis but appears in some logic-checking scenarios.
✏️ Practice Exercise
Build an automated loan eligibility checker. Input fields: Credit Score, Monthly Income, Existing EMI, Loan Requested. Using AND, OR, and IF, create rules: (1) Auto-Approve if score>750 AND income>3x EMI AND requested<50x income, (2) Manual Review if score 650-750 OR income borderline, (3) Reject otherwise. Add IFERROR around any division. Display result, reason, and maximum eligible loan amount.
Learn Excel with Live Trainer Guidance
These tutorials give you the foundations. Our live Excel course at EVIKA Academy, Noida teaches you to build real dashboards on actual business data — with a trainer who uses Excel professionally every day.