Logical Functions | Excel Tutorial - Learn with VOKS
Back Next

Logical Functions


Logical functions help Excel make decisions.

Think of them like asking a question:

"If this condition is true, do this. Otherwise, do something else."

1️⃣ What Are Logical Functions?

Logical functions test whether something is:

  • TRUE
  • FALSE

They are used when you want Excel to:

  • Compare numbers
  • Apply conditions
  • Automate decisions
  • Categorize data

2️⃣ The IF Function (Most Important Logical Function)

🔹 What IF Does

It checks a condition and returns one value if TRUE and another if FALSE.

🔹 Syntax

=IF(logical_test, value_if_true, value_if_false)

🔹 Example 1: Pass or Fail

Dataset

| Student | Score |
|---------|-------|
| John    | 75    |
| Mary    | 45    |
| David   | 60    |
| Anna    | 30    |

Rule:

  • Score ≥ 50 → Pass
  • Score < 50 → Fail

Formula:

=IF(B2>=50,"Pass","Fail")

Result

| Student | Score | Result |
|---------|-------|--------|
| John    | 75    | Pass   |
| Mary    | 45    | Fail   |
| David   | 60    | Pass   |
| Anna    | 30    | Fail   |

3️⃣ Logical Operators (Used Inside IF)

| Operator | Meaning               |
|----------|-----------------------|
|    =     | Equal to              |
|    >     | Greater than          |
|    <     | Less than             | 
|   >=     | Greater than or equal | 
|   <=     | Less than or equal    | 
|   <>     | Not equal             | 

4️⃣ Nested IF (Multiple Conditions)

Sometimes you need more than two outcomes.

Example: Grading System

Rules:

  • ≥ 80 → Distinction
  • ≥ 50 → Pass
  • < 50 → Fail

Dataset

| Student | Score |
|---------|-------|
| John    | 85    |
| Mary    | 67    |
| David   | 45    |
| Anna    | 92    |

Formula:

=IF(B2>=80,"Distinction",IF(B2>=50,"Pass","Fail"))

Result

| Student | Score | Grade       |
|---------|-------|-------------|
| John    | 85    | Distinction |
| Mary    | 67    | Pass        |
| David   | 45    | Fail        |
| Anna    | 92    | Distinction |

5️⃣ AND Function

🔹 What It Does

Returns TRUE only if ALL conditions are true.

🔹 Syntax

=AND(condition1, condition2, ...)

🔹 Example

Rule:

  • Pass only if Score ≥ 50 AND Attendance ≥ 75%

Dataset

| Student | Score | Attendance |
|---------|-------|------------|
| John    | 75    | 80%        |
| Mary    | 60    | 60%        |
| David   | 45    | 90%        |
| Anna    | 85    | 95%        |

Formula

=IF(AND(B2>=50,C2>=75),"Pass","Fail")

Result

| Student | Score | Attendance | Result |
|---------|-------|------------|--------|
| John    | 75    | 80%        | Pass   |
| Mary    | 60    | 60%        | Fail   |
| David   | 45    | 90%        | Fail   |
| Anna    | 85    | 95%        | Pass   |

6️⃣ OR Function

🔹 What It Does

Returns TRUE if at least one condition is true.

🔹 Syntax

=OR(condition1, condition2, ...)

Example

Rule:

  • Bonus if Sales ≥ 8000 OR Experience ≥ 5 years
=IF(OR(B2>=8000,C2>=5),"Bonus","No Bonus")

7️⃣ NOT Function

🔹 What It Does

Reverses TRUE/FALSE.

If TRUE → FALSE

If FALSE → TRUE

=NOT(A2>50)

8️⃣ TRUE and FALSE Functions

Excel has built-in logical values:

=TRUE()
=FALSE()

Usually used in advanced formulas.

9️⃣ Real Business Example

Sales Performance

| Employee | Sales | Target |
|----------|-------|--------|
| John     | 9000  | 8000   |
| Mary     | 7000  | 8000   |
| David    | 8500  | 8000   |
| Anna     | 6000  | 8000   |

Formula

=IF(B2>=C2,"Target Met","Target Not Met")

Result

| Employee | Sales | Target | Status          |
|----------|-------|--------|----------------|
| John     | 9000  | 8000   | Target Met     |
| Mary     | 7000  | 8000   | Target Not Met |
| David    | 8500  | 8000   | Target Met     |
| Anna     | 6000  | 8000   | Target Not Met |

🔟 Why Logical Functions Are Important

They allow you to:

  • Categorize data
  • Create grading systems
  • Evaluate performance
  • Apply business rules
  • Automate decisions

Without logical functions, Excel would only calculate — not decide.

Excel
Introduction Setting Up Your Environment Navigating the Worksheet Environment Data Trimming, Sorting and Filtering Tables, Nesting Functions Understanding and Classifying Data Types, Changing to Text and Rounding Values Cleaning the data, Joining text strings, Capitalizing words, Using upper and lower case, Extracting text from cells, Counting characters, Extracting text, Replacing characters Preparing date data, Finding days of the week, Finding the matching column Using Vlookup, Hlookup, Index, Pivot tables and case studies Using count, Counta, Countblank, Count if functions Math Functions in Excel Using Minimum, Maximum, Averages to aggregate data Logical Functions Conditional Aggregation Using the IF Function Getting Familiar with Different Visuals Available in Excel and When to Use Them Analyzing Data with Line and Area Charts Analyzing Data with Stacked Area Chart and 100% Stacked Chart Building a Dashboard in Excel
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL