Microsoft Excel Mastery

Part II: Essential Excel Functions

Master Mathematical, Logical, Text, and Date/Time functions β€” with 140+ solved examples, real Indian datasets, and hands-on projects.

πŸ“ 40+ Formulas  |  πŸ’» 4 Mini Projects  |  πŸ“ 20+ MCQs  |  🎯 12 Interview Questions

Chapter 4

Mathematical Functions

πŸ“Š Why Math Functions Matter in Every Indian Office

Whether you're a CA calculating GST returns, an HR manager computing salary breakdowns, or a teacher averaging CBSE marks for 500 students β€” Excel's mathematical functions save hours of manual computation. India's β‚Ή3.5 lakh crore GST collection every month is processed using spreadsheets at the ground level before entering GSTN portals.

InfosysTCS PayrollCBSE SchoolsGST Returns

🎯 Learning Objectives

  • Use SUM, AVERAGE, MIN, MAX for basic calculations
  • Apply ROUND, ROUNDUP, ROUNDDOWN for precision control
  • Understand ABS, MOD, and POWER for advanced math
  • Master conditional functions: SUMIF, COUNTIF, AVERAGEIF and their multi-criteria variants
  • Use INT, CEILING, FLOOR for rounding variations
  • Solve 40+ real-world problems using mathematical functions
Section 4.1

SUM & AVERAGE Functions

Theory β€” The SUM Function

The SUM function is the most frequently used function in Excel. It adds up all the numbers you specify. Think of it as a calculator that can add thousands of numbers in a single keystroke. Every accountant in India β€” from a small shop in Chandni Chowk to the finance department at Reliance Industries β€” uses SUM daily.

πŸ“ Formula Syntax
=SUM(number1, [number2], ...)
number1 (required): The first number, cell reference, or range to add. number2, ... (optional): Additional numbers/ranges, up to 255 arguments. SUM ignores text and logical values.
[Screenshot: SUM function being typed in the formula bar with cell references highlighted]

Example 1 β€” Sum a Simple Range (Monthly Sales)

A Flipkart seller wants to know total sales for Q1 (January–March):

AB
MonthSales (β‚Ή)
January1,25,000
February1,48,000
March1,62,000

Formula in B5: =SUM(B2:B4)

Result: β‚Ή4,35,000

Explanation: The function takes the range B2:B4 (all three months) and adds them: 1,25,000 + 1,48,000 + 1,62,000 = 4,35,000.

Example 2 β€” Sum Non-Contiguous Cells (Expense Report)

An employee at TCS has expenses in cells that are not next to each other:

AB
Travel (B2)8,500
Meals (B3)2,200
Hotel (B4)12,000
Courier (B5)450
Cab (B6)3,800

Formula: =SUM(B2, B4, B6) β€” to sum only Travel, Hotel, and Cab expenses.

Result: β‚Ή24,300

Explanation: By passing individual cells separated by commas, you can pick specific items: 8,500 + 12,000 + 3,800 = 24,300.

Example 3 β€” 3D Reference SUM Across Sheets

A Reliance Jio store manager has monthly sales in separate sheets (Jan, Feb, Mar), with totals always in cell B10 of each sheet:

Formula: =SUM(Jan:Mar!B10)

Result: Adds B10 from every sheet between Jan and Mar

Explanation: A 3D reference lets you sum the same cell across multiple worksheets. This is powerful for monthly/quarterly consolidation. If Jan!B10 = 5,00,000, Feb!B10 = 6,20,000, Mar!B10 = 5,80,000, the result would be β‚Ή17,00,000.

Press Alt + = to instantly insert a SUM formula for the selected range. Excel intelligently detects whether to sum the column above or the row to the left.

Theory β€” The AVERAGE Function

The AVERAGE function calculates the arithmetic mean β€” it adds all numbers and divides by the count. In Indian schools, teachers use this constantly: average marks of a class, average attendance percentage, or average score across subjects.

πŸ“ Formula Syntax
=AVERAGE(number1, [number2], ...)
number1 (required): First number, reference, or range. number2, ... (optional): Additional values. AVERAGE ignores blank cells but includes cells containing 0.

Example 1 β€” Class Average (CBSE School)

A teacher at Delhi Public School wants to find the average Mathematics marks for 5 students:

AB
StudentMaths Marks
Aarav87
Priya92
Rahul76
Sneha95
Vikram83

Formula in B7: =AVERAGE(B2:B6)

Result: 86.6

Calculation: (87 + 92 + 76 + 95 + 83) Γ· 5 = 433 Γ· 5 = 86.6

Example 2 β€” Average Monthly Sales (Zomato Delivery Partner)

MonthOrders Delivered
Jan342
Feb298
Mar376
Apr415
May389
Jun401

Formula: =AVERAGE(B2:B7)

Result: 370.17

Example 3 β€” Average with Non-Contiguous Cells

Average only the first and last exam scores: =AVERAGE(B2, B6)

Result: (87 + 83) Γ· 2 = 85

AVERAGE vs. blank cells: If a cell is blank, AVERAGE ignores it (doesn't count it in the denominator). But if a cell contains 0, it IS included. So an empty cell and a cell with 0 give different averages! For instance, AVERAGE(10, 20, 0) = 10, but AVERAGE(10, 20, blank) = 15.

Section 4.2

MIN, MAX & ROUND Functions

The MIN Function

πŸ“ Formula Syntax
=MIN(number1, [number2], ...)
Returns the smallest value in a set of numbers. Ignores empty cells, text, and logical values.

Example 1 β€” Lowest Marks in Class

StudentScience
Aisha78
Rohan54
Kavya91
Dev67
Meera82

Formula: =MIN(B2:B6)

Result: 54 (Rohan's score)

Example 2 β€” Lowest Salary in Department

HR at Wipro wants to find the minimum CTC in the Engineering department:

EmployeeCTC (β‚Ή LPA)
Amit6.5
Pooja8.2
Karthik5.8
Ritu12.1

Formula: =MIN(B2:B5)

Result: 5.8 (β‚Ή5.8 LPA β€” Karthik)

Example 3 β€” MIN Across Multiple Ranges

=MIN(B2:B5, D2:D5) β€” finds the minimum value across two separate columns (e.g., comparing two departments' salaries).

The MAX Function

πŸ“ Formula Syntax
=MAX(number1, [number2], ...)
Returns the largest value in a set. Syntax is identical to MIN but returns the highest instead of lowest.

Example 1 β€” Highest Marks (Topper)

Using the same student data above: =MAX(B2:B6)

Result: 91 (Kavya's score β€” she's the topper!)

Example 2 β€” Peak Daily Sales

DaySales (β‚Ή)
Monday45,200
Tuesday38,900
Wednesday52,100
Thursday41,600
Friday67,800
Saturday78,400

Formula: =MAX(B2:B7)

Result: β‚Ή78,400 (Saturday)

Example 3 β€” Difference Between Highest & Lowest (Range)

=MAX(B2:B7) - MIN(B2:B7)

Result: 78,400 - 38,900 = β‚Ή39,500 (this is the sales range/spread)

The ROUND Function Family

πŸ“ Formula Syntax
=ROUND(number, num_digits)
number: The value to round. num_digits: Number of decimal places. Use 0 for whole number, negative values to round to tens/hundreds. ROUNDUP always rounds away from zero; ROUNDDOWN always rounds toward zero.

Example 1 β€” Round GST Calculation

Product price: β‚Ή1,249. GST @18%:

=ROUND(1249 * 0.18, 2)

Result: β‚Ή224.82

Without ROUND: 224.82 exactly. But what if the result were 224.825? ROUND would make it 224.83 (rounds 5 up).

Example 2 β€” ROUNDUP for Ceiling Pricing

An Amazon seller wants to always round up to the nearest rupee:

=ROUNDUP(224.82, 0)

Result: β‚Ή225

Example 3 β€” ROUNDDOWN for Conservative Estimates

=ROUNDDOWN(3.789, 2)

Result: 3.78 (drops everything beyond 2 decimal places)

Round to Nearest 10, 100, 1000

FormulaResultExplanation
=ROUND(15847, -1)15850Nearest 10
=ROUND(15847, -2)15800Nearest 100
=ROUND(15847, -3)16000Nearest 1000

Students often confuse ROUND, ROUNDUP, ROUNDDOWN, INT, CEILING, and FLOOR. Create a comparison table on the board using the same number (e.g., 7.6 and -7.6) to show how each behaves differently, especially with negative numbers.

Section 4.3

ABS, MOD & POWER Functions

ABS β€” Absolute Value

πŸ“ Formula Syntax
=ABS(number)
Returns the absolute value β€” removes the negative sign. ABS(-5) = 5, ABS(5) = 5. Useful for calculating differences regardless of direction.

Example 1 β€” Budget Variance

Budgeted: β‚Ή5,00,000. Actual: β‚Ή5,43,000. What's the absolute difference?

=ABS(500000 - 543000)

Result: 43,000 (positive, regardless of over/under budget)

Example 2 β€” Temperature Difference

=ABS(-4 - 8)

Result: 12 (difference between -4Β°C and 8Β°C)

Example 3 β€” Stock Price Movement

Opening: β‚Ή2,340. Closing: β‚Ή2,298. Absolute change: =ABS(2340-2298)

Result: β‚Ή42

MOD β€” Remainder After Division

πŸ“ Formula Syntax
=MOD(number, divisor)
Returns the remainder after dividing number by divisor. The result has the same sign as the divisor. MOD(10, 3) = 1 because 10 Γ· 3 = 3 remainder 1.

Example 1 β€” Check Odd or Even

Is roll number 247 odd or even?

=MOD(247, 2)

Result: 1 (remainder is 1, so it's ODD)

Combine with IF: =IF(MOD(A2,2)=0, "Even", "Odd")

Example 2 β€” Every 3rd Row Highlight Logic

To check if a row number is divisible by 3 (for conditional formatting):

=MOD(ROW(), 3) = 0

Returns TRUE for rows 3, 6, 9, 12, ...

Example 3 β€” Remaining Items After Packaging

A factory has 1,247 chocolates. Each box holds 12. How many left over?

=MOD(1247, 12)

Result: 11 (1247 Γ· 12 = 103 boxes, 11 remaining)

POWER β€” Exponentiation

πŸ“ Formula Syntax
=POWER(number, power)
Returns number raised to the power. Equivalent to the ^ operator: POWER(2,3) = 2^3 = 8. Used for compound interest, area calculations, growth projections.

Example 1 β€” Compound Interest

Principal β‚Ή1,00,000 at 8% for 5 years compounded annually:

=100000 * POWER(1 + 0.08, 5)

Result: β‚Ή1,46,932.81

Breakdown: 1,00,000 Γ— (1.08)⁡ = 1,00,000 Γ— 1.469328 = β‚Ή1,46,932.81

Example 2 β€” Area of Circle

Radius = 7 cm: =3.14159 * POWER(7, 2)

Result: 153.94 sq cm

Example 3 β€” Population Growth

India's population 140 crore, growing at 0.7% per year. After 10 years:

=140 * POWER(1.007, 10)

Result: 150.04 crore

The ^ operator works identically to POWER. So =2^10 gives 1024, same as =POWER(2,10). Most Excel pros use ^ because it's faster to type!

INT, CEILING & FLOOR

πŸ“ Formula Syntax
=INT(number)  |  =CEILING(number, significance)  |  =FLOOR(number, significance)
INT: Rounds down to the nearest integer. CEILING: Rounds up to the nearest multiple of significance. FLOOR: Rounds down to the nearest multiple.
FormulaResultWhat It Does
=INT(7.8)7Drops decimals, rounds toward zero
=INT(-7.8)-8Rounds toward negative infinity
=CEILING(42, 5)45Next multiple of 5 above 42
=CEILING(123, 50)150Next multiple of 50
=FLOOR(42, 5)40Previous multiple of 5 below 42
=FLOOR(123, 50)100Previous multiple of 50

Practical Use β€” Pricing to Nearest β‚Ή49/β‚Ή99

E-commerce sites price products at β‚ΉX99. To round β‚Ή1,247 to the nearest β‚Ή99-ending:

=CEILING(1247, 100) - 1

Result: β‚Ή1,299

Alt + = β€” AutoSum: instantly inserts SUM for the selected range

Ctrl + Shift + Enter β€” Enter an array formula (legacy CSE arrays)

F9 β€” Evaluate part of a formula (select part in formula bar, press F9)

F2 β€” Edit the active cell's formula

Ctrl + ` β€” Toggle formula view (show all formulas in cells)

Section 4.4

SUMIF, COUNTIF & AVERAGEIF β€” Conditional Functions

These are the "smart" versions of SUM, COUNT, and AVERAGE. Instead of calculating all values, they only include values that meet a specific condition. This is enormously useful in real business scenarios.

SUMIF β€” Conditional Sum

πŸ“ Formula Syntax
=SUMIF(range, criteria, [sum_range])
range: The range to evaluate. criteria: The condition (number, text, expression like ">100"). sum_range (optional): The actual cells to sum. If omitted, the range cells are summed.
ABC
ProductRegionSales (β‚Ή)
LaptopNorth2,50,000
PhoneSouth1,80,000
LaptopSouth3,10,000
TabletNorth95,000
PhoneNorth2,20,000
LaptopWest2,75,000

Example 1 β€” Sum All Laptop Sales

=SUMIF(A2:A7, "Laptop", C2:C7)

Result: β‚Ή8,35,000 (2,50,000 + 3,10,000 + 2,75,000)

Example 2 β€” Sum Sales from North Region

=SUMIF(B2:B7, "North", C2:C7)

Result: β‚Ή5,65,000 (2,50,000 + 95,000 + 2,20,000)

Example 3 β€” Sum Sales Greater Than β‚Ή2,00,000

=SUMIF(C2:C7, ">200000")

Result: β‚Ή10,55,000 (all sales above 2 lakhs)

SUMIFS β€” Multiple Criteria

πŸ“ Formula Syntax
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Note: Unlike SUMIF, the sum_range comes FIRST in SUMIFS. You can specify up to 127 criteria pairs.

Example β€” Laptop Sales in North Region Only

=SUMIFS(C2:C7, A2:A7, "Laptop", B2:B7, "North")

Result: β‚Ή2,50,000 (only Laptop + North)

SUMIF vs SUMIFS argument order: In SUMIF, the sum_range is the LAST argument. In SUMIFS, the sum_range is the FIRST argument. Mixing these up is one of the most common errors! Remember: SUMIF = range, criteria, sum_range. SUMIFS = sum_range, range1, criteria1, range2, criteria2.

COUNTIF β€” Count with Condition

πŸ“ Formula Syntax
=COUNTIF(range, criteria)
Counts the number of cells that meet a condition. The criteria can be a number, text, or expression.

Example 1 β€” Count Students Who Passed (β‰₯33)

StudentMarks
Amit45
Neha28
Raj72
Sunita31
Deepak89
Fatima55

=COUNTIF(B2:B7, ">=33")

Result: 4 (Amit-45, Raj-72, Deepak-89, Fatima-55 all β‰₯ 33)

Example 2 β€” Count Specific Product

=COUNTIF(A2:A7, "Phone") (from sales data above)

Result: 2

Example 3 β€” Count Blank Cells

=COUNTIF(A2:A20, "")

Counts how many cells in A2:A20 are empty

COUNTIFS β€” Multiple Conditions

πŸ“ Formula Syntax
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Counts cells that satisfy ALL specified conditions simultaneously.

Example β€” Count Laptops Sold in North

=COUNTIFS(A2:A7, "Laptop", B2:B7, "North")

Result: 1

AVERAGEIF & AVERAGEIFS

πŸ“ Formula Syntax
=AVERAGEIF(range, criteria, [average_range])
Calculates the average of cells that meet a condition. Works like SUMIF but computes mean instead of sum.

Example 1 β€” Average Salary of Engineers

EmployeeDepartmentSalary (β‚Ή)
AmanEngineering75,000
PriyaMarketing55,000
KaranEngineering82,000
DivyaHR48,000
SureshEngineering91,000

=AVERAGEIF(B2:B6, "Engineering", C2:C6)

Result: β‚Ή82,667 (average of 75000, 82000, 91000)

Example 2 β€” Average Marks Above 60

=AVERAGEIF(B2:B7, ">60")

Result: Average of only those marks that exceed 60

Example 3 β€” AVERAGEIFS with Multiple Criteria

=AVERAGEIFS(C2:C6, B2:B6, "Engineering", C2:C6, ">70000")

Result: Average salary of Engineers earning above β‚Ή70,000

Use wildcards in criteria: * matches any sequence of characters, ? matches any single character. Example: =COUNTIF(A:A, "Lap*") counts cells starting with "Lap" β€” matching Laptop, Lapel, etc.

Section 4.5

Practice Exercises, MCQs & Interview Questions

Practice Exercises

Exercise 1 β€” Monthly Household Budget

Create a spreadsheet with the following monthly expenses for a family in Pune: Rent β‚Ή18,000, Groceries β‚Ή8,500, Electricity β‚Ή2,800, Internet β‚Ή1,200, Transport β‚Ή4,500, Education β‚Ή6,000, Entertainment β‚Ή3,000, Medical β‚Ή2,000. Use SUM for total, AVERAGE for average expense, MAX for highest, MIN for lowest, and ROUND to round average to nearest β‚Ή10.

Answer: Total = β‚Ή46,000 | Average = β‚Ή5,750 | Max = β‚Ή18,000 (Rent) | Min = β‚Ή1,200 (Internet) | Rounded = β‚Ή5,750

Exercise 2 β€” GST Invoice Calculator

Create a product list: Item A β‚Ή1,250, Item B β‚Ή3,475, Item C β‚Ή890, Item D β‚Ή6,200, Item E β‚Ή2,150. Calculate: (a) CGST @9% for each item using ROUND to 2 decimals, (b) SGST @9% (same), (c) Total amount with GST, (d) ROUNDUP the grand total to nearest β‚Ή100.

Answer (Item A): CGST = ROUND(1250Γ—0.09, 2) = β‚Ή112.50 | SGST = β‚Ή112.50 | Total = β‚Ή1,475 | Grand total all items ROUNDUP = β‚Ή16,500

Exercise 3 β€” Odd/Even Classification

Create a list of 20 roll numbers (101–120). Use MOD and IF to classify each as "Odd" or "Even".

Formula: =IF(MOD(A2,2)=0, "Even", "Odd")

Exercise 4 β€” Fixed Deposit Calculator

Use POWER to calculate maturity amount for: Principal β‚Ή2,00,000, Rate 7.5%, Period 3 years (compounded quarterly).

Formula: =200000 * POWER(1 + 0.075/4, 4*3)

Answer: β‚Ή2,49,696.89

Exercise 5 β€” Conditional Sales Analysis

Using the product sales dataset from Section 4.4, calculate: (a) Total Phone sales, (b) Number of South region transactions, (c) Average sales for North region, (d) Count of sales above β‚Ή2,00,000.

Answers: (a) SUMIF: β‚Ή4,00,000 (b) COUNTIF: 2 (c) AVERAGEIF: β‚Ή1,88,333 (d) COUNTIF: 4

Exercise 6 β€” Employee Salary Summary

Create a dataset with 15 employees (Name, Department [IT/Sales/HR], City [Delhi/Mumbai/Bangalore], Salary). Use SUMIFS to find total IT salary in Delhi. Use COUNTIFS to count Sales employees in Mumbai. Use AVERAGEIFS for average HR salary in Bangalore.

Exercise 7 β€” Temperature Data Analysis

Record temperatures for 7 cities: Delhi 45Β°C, Mumbai 33Β°C, Shimla 18Β°C, Jaipur 44Β°C, Srinagar 8Β°C, Chennai 38Β°C, Bangalore 28Β°C. Find: SUM, AVERAGE, MIN, MAX, difference between hottest and coldest, ABS difference between Delhi and Shimla.

Answers: SUM=214 | AVG=30.57 | MIN=8 | MAX=45 | Range=37 | ABS(45-18)=27

Exercise 8 β€” CEILING & FLOOR Pricing

Given prices: β‚Ή127, β‚Ή243, β‚Ή589, β‚Ή1,067, β‚Ή3,842. Round each to nearest β‚Ή50 using CEILING and FLOOR. Show the difference.

Exercise 9 β€” Cricket Score Analysis

Create a dataset of 10 IPL batsmen with Name, Team, Runs, Matches. Use SUMIF for total runs by team, COUNTIF for players with 400+ runs, AVERAGEIF for average runs of a specific team.

Exercise 10 β€” Attendance Tracker

30 students, 20 working days. Use COUNTIF to count "P" (present) and "A" (absent) for each student. Use AVERAGEIF for average attendance of students with more than 15 days present.

Exercise 11 β€” Inventory Management

Create an inventory: 10 products with Category [Electronics/Clothing/Food], Quantity, Price. Use SUMIF for total value of Electronics, COUNTIF for items with quantity below 10, SUMIFS for Electronics with price above β‚Ή1,000.

Exercise 12 β€” EMI Calculator

Loan β‚Ή10,00,000, Rate 9.5%, Tenure 20 years. Use POWER to calculate: (a) Monthly interest factor (1+r)^n, (b) Total interest paid, (c) Use INT to show whole-number EMI.

Exercise 13 β€” CBSE Board Results

50 students with marks in 5 subjects. Calculate: total marks (SUM), percentage (AVERAGE), highest in each subject (MAX), students scoring above 90% (COUNTIF), average marks of students above 80% (AVERAGEIF).

Exercise 14 β€” Zomato Order Analysis

20 orders: Customer, Restaurant, Area [Koramangala/Indiranagar/HSR], Amount, Rating. Use SUMIF for total orders from Koramangala, AVERAGEIF for average rating above 4, COUNTIFS for Koramangala orders above β‚Ή500.

Exercise 15 β€” SIP Calculator

Monthly SIP β‚Ή5,000, Expected return 12% p.a. (1% monthly), Period 15 years. Use POWER and formula: FV = P Γ— [(1+r)^n - 1]/r Γ— (1+r). Calculate the future value.

MCQ Quiz β€” Chapter 4

Q1

What does =SUMIF(A1:A10, ">50") do?

  1. Sums all values in A1:A10
  2. Sums values greater than 50 in A1:A10
  3. Counts values greater than 50
  4. Returns an error because sum_range is missing
βœ… b) Sums values greater than 50 in A1:A10. When sum_range is omitted in SUMIF, the range itself is used for summing.
Q2

What is the result of =MOD(17, 5)?

  1. 3
  2. 2
  3. 3.4
  4. 5
βœ… b) 2. 17 Γ· 5 = 3 remainder 2. MOD returns the remainder.
Q3

In SUMIFS, where does the sum_range argument appear?

  1. Last argument
  2. Second argument
  3. First argument
  4. It doesn't exist in SUMIFS
βœ… c) First argument. SUMIFS(sum_range, criteria_range1, criteria1, ...). This is opposite to SUMIF where sum_range comes last.
Q4

What does =ROUND(2.555, 2) return?

  1. 2.55
  2. 2.56
  3. 2.6
  4. 3
βœ… b) 2.56. ROUND rounds 5 up, so 2.555 rounded to 2 decimal places = 2.56.
Q5

If A1=10 and A2 is blank, what does =AVERAGE(A1, A2) return?

  1. 5
  2. 10
  3. #DIV/0!
  4. 0
βœ… b) 10. AVERAGE ignores blank cells. It sees only one value (10) and divides by 1, not by 2. However, if A2 contained 0, the result would be 5.

Interview Questions

Q1: What is the difference between SUMIF and SUMIFS? When would you use each?

Answer: SUMIF allows only ONE condition (range, criteria, sum_range), while SUMIFS allows MULTIPLE conditions (sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...). Key difference: the argument order is different β€” in SUMIF, sum_range comes last; in SUMIFS, it comes first.

When to use: Use SUMIF when you have a single condition (e.g., sum all sales for "North" region). Use SUMIFS when you need multiple conditions (e.g., sum sales for "North" region AND "Laptop" product).

Real-world example: In a GST return, SUMIF can sum all sales in a specific tax slab. SUMIFS can sum sales for a specific product category in a specific state under a specific tax slab.

Q2: How does AVERAGE handle blank cells vs cells containing zero?

Answer: AVERAGE ignores blank cells entirely β€” they are not counted in the numerator or denominator. However, cells containing 0 ARE included. This is a critical distinction:

AVERAGE(10, 20, blank) = (10+20)/2 = 15

AVERAGE(10, 20, 0) = (10+20+0)/3 = 10

This matters in employee performance tracking β€” a missing review (blank) should not lower the average, but a zero rating should.

Q3: Explain a real-world use case for the MOD function in business reporting.

Answer: MOD is extensively used for: (1) Alternating row formatting β€” =MOD(ROW(),2)=0 in conditional formatting highlights every other row. (2) Distributing items evenly β€” if 1,000 leads must be split among 7 sales reps, MOD tells you 6 leads remain after equal distribution. (3) Shift scheduling β€” MOD(day_number, 3) determines which of 3 shifts an employee is on. (4) Batch processing β€” processing invoices in batches of 100, MOD identifies the last incomplete batch.

Section 4.6

Mini Project & Chapter Summary

🎯 Mini Project: Student Marks Analysis System

Problem Statement

A CBSE school needs a comprehensive marks analysis system for Class 10 board exams. Create an Excel workbook that analyzes student performance across 5 subjects.

Dataset Requirements

Create data for 20 students with columns: Roll Number, Name, English, Hindi, Mathematics, Science, Social Science.

Deliverables

  1. Total Marks: Use SUM to calculate total marks for each student (out of 500)
  2. Percentage: Calculate percentage using =SUM()/5 and ROUND to 2 decimals
  3. Class Average: AVERAGE of each subject column
  4. Subject Topper: MAX for each subject
  5. Lowest Score: MIN for each subject
  6. Pass Count: COUNTIF β€” count students scoring β‰₯33 in each subject
  7. Fail Count: COUNTIF β€” count students scoring <33
  8. Distinction Count: COUNTIF β€” count students with percentage β‰₯75%
  9. First Division: COUNTIF β€” 60% to 74.99%
  10. Average of Passed Students: AVERAGEIF β€” average marks of students who scored β‰₯33 in each subject
  11. Total Marks of Top Scorers: SUMIF β€” sum total marks of students with percentage β‰₯90%
  12. Subject-wise Analysis Table: Summary table with Subject, Average, Max, Min, Pass%, Fail%
[Screenshot: Completed Student Marks Analysis dashboard with summary statistics]

πŸ“‹ Chapter 4 Summary β€” Mathematical Functions

  • SUM adds numbers; supports ranges, non-contiguous cells, and 3D references across sheets
  • AVERAGE calculates arithmetic mean; ignores blanks but includes zeros
  • MIN / MAX find smallest/largest values in a range
  • ROUND, ROUNDUP, ROUNDDOWN control decimal precision; negative num_digits round to tens/hundreds
  • ABS returns absolute value β€” useful for variance calculations
  • MOD returns remainder β€” use for odd/even checks, batch sizing
  • POWER (or ^) calculates exponents β€” compound interest, growth projections
  • INT truncates to integer; CEILING rounds up to multiple; FLOOR rounds down to multiple
  • SUMIF/SUMIFS sum conditionally β€” note the different argument order!
  • COUNTIF/COUNTIFS count cells matching conditions
  • AVERAGEIF/AVERAGEIFS calculate conditional averages
  • Use Alt+= for quick AutoSum; F9 to evaluate formula parts

Start with SUM and AVERAGE β€” students are familiar with these concepts from math class. Build confidence before introducing SUMIF/COUNTIF. Use the class marks dataset as it directly relates to their experience. Have students create the Mini Project step-by-step, adding one formula at a time. Allocate 2 class periods: 1 for basic functions, 1 for conditional functions.

Chapter 5

Logical Functions

🧠 Making Excel Think: Decision-Making with Formulas

Every business runs on decisions. Should this employee get a bonus? Does this student pass? Which tax slab applies to this salary? Is this loan application eligible? Logical functions turn Excel from a calculator into a decision-making engine. India's income tax system with its multiple slabs, CBSE's grading system, and corporate bonus structures all translate perfectly into Excel's IF-based logic.

Income Tax DeptCBSE GradingHR PayrollLoan Processing

🎯 Learning Objectives

  • Write IF statements for single-condition decisions
  • Build nested IF formulas for multi-level grading and tax slabs
  • Use IFS as a cleaner alternative to nested IF
  • Combine conditions with AND, OR, NOT
  • Handle errors gracefully with IFERROR
  • Use SWITCH for value-based matching
  • Apply logical functions to real Indian scenarios: tax, grading, loan eligibility
Section 5.1

IF Function & Nested IF

Theory β€” The IF Function

The IF function is the most important logical function in Excel. It tests a condition and returns one value if TRUE, another if FALSE. Think of it as a simple question: "If this condition is met, do this; otherwise, do that." It's like a traffic signal β€” green means go, red means stop.

πŸ“ Formula Syntax
=IF(logical_test, value_if_true, value_if_false)
logical_test: A condition that evaluates to TRUE or FALSE (e.g., A1>50). value_if_true: What to return if condition is TRUE. value_if_false: What to return if condition is FALSE. Both value arguments can be numbers, text (in quotes), formulas, or even other IF functions.
[Screenshot: IF function dialog box showing logical_test, value_if_true, value_if_false fields]

Example 1 β€” Pass / Fail (CBSE)

In CBSE, minimum passing marks = 33 out of 100:

ABC
StudentMarksResult
Arjun78=IF(B2>=33,"Pass","Fail")
Meena25=IF(B3>=33,"Pass","Fail")
Vishal33=IF(B4>=33,"Pass","Fail")

Results: Arjun β†’ Pass, Meena β†’ Fail, Vishal β†’ Pass (33 is exactly the pass mark)

Example 2 β€” Bonus Eligibility

Employees at Infosys with rating β‰₯ 4 (out of 5) get a bonus:

=IF(C2>=4, "Eligible", "Not Eligible")

If C2 = 4.5 β†’ "Eligible" | If C2 = 3 β†’ "Not Eligible"

Example 3 β€” Discount Based on Purchase Amount

A BigBazaar store offers 10% discount on purchases above β‚Ή2,000:

=IF(B2>2000, B2*0.10, 0)

If B2 = β‚Ή3,500 β†’ β‚Ή350 discount | If B2 = β‚Ή1,200 β†’ β‚Ή0

Theory β€” Nested IF (Multiple Conditions)

When you have more than two outcomes, you nest IF functions inside each other. The value_if_false of one IF becomes another IF. Think of it as a decision tree: each branch leads to either a result or another question.

πŸ“ Formula Syntax β€” Nested IF
=IF(condition1, result1, IF(condition2, result2, IF(condition3, result3, default_result)))
Excel allows up to 64 levels of nesting. However, beyond 3-4 levels, use IFS or SWITCH for readability.

Example 1 β€” CBSE Grading System

CBSE uses this grading scale: 91–100 = A1, 81–90 = A2, 71–80 = B1, 61–70 = B2, 51–60 = C1, 41–50 = C2, 33–40 = D, Below 33 = E (Fail)

StudentMarksGrade Formula
Priya95=IF(B2>=91,"A1", IF(B2>=81,"A2", IF(B2>=71,"B1", IF(B2>=61,"B2", IF(B2>=51,"C1", IF(B2>=41,"C2", IF(B2>=33,"D","E")))))))
Raj72
Sunita45
Deepak28

Results: Priya β†’ A1 | Raj β†’ B1 | Sunita β†’ C2 | Deepak β†’ E

Example 2 β€” Indian Income Tax Slabs (New Regime 2024-25)

For the new tax regime:

Income SlabTax Rate
Up to β‚Ή3,00,000Nil
β‚Ή3,00,001 – β‚Ή6,00,0005%
β‚Ή6,00,001 – β‚Ή9,00,00010%
β‚Ή9,00,001 – β‚Ή12,00,00015%
β‚Ή12,00,001 – β‚Ή15,00,00020%
Above β‚Ή15,00,00030%

Simplified formula for tax slab identification (not total tax):

=IF(B2<=300000, "Nil",
  IF(B2<=600000, "5%",
    IF(B2<=900000, "10%",
      IF(B2<=1200000, "15%",
        IF(B2<=1500000, "20%", "30%")))))

For income β‚Ή8,50,000: the formula checks each slab and returns "10%".

Example 3 β€” Discount Tiers (E-Commerce)

A Myntra-style discount structure:

Cart ValueDiscount
Above β‚Ή5,00020%
β‚Ή3,000 – β‚Ή5,00015%
β‚Ή1,000 – β‚Ή2,99910%
Below β‚Ή1,0005%

=IF(B2>5000, B2*0.20, IF(B2>=3000, B2*0.15, IF(B2>=1000, B2*0.10, B2*0.05)))

Cart value β‚Ή4,200: β†’ β‚Ή4,200 Γ— 0.15 = β‚Ή630 discount

IFS Function β€” Cleaner Alternative

πŸ“ Formula Syntax
=IFS(condition1, value1, condition2, value2, ..., TRUE, default_value)
Evaluates conditions in order and returns the value of the first TRUE condition. Use TRUE as the last condition for a default/else value. Available in Excel 2019 and Microsoft 365.

Example β€” CBSE Grading with IFS (much cleaner!)

=IFS(B2>=91, "A1",
     B2>=81, "A2",
     B2>=71, "B1",
     B2>=61, "B2",
     B2>=51, "C1",
     B2>=41, "C2",
     B2>=33, "D",
     TRUE,   "E")

This is functionally identical to the nested IF but far easier to read and maintain.

Forgetting the default case in IFS: If no condition is TRUE and you don't include TRUE, default_value at the end, IFS returns a #N/A error. Always add the TRUE catch-all as the last pair!

When writing nested IFs, always start with the HIGHEST condition and work DOWN (or lowest and work UP β€” just be consistent). If you write =IF(B2>=33,"D", IF(B2>=41,"C2",...)), every student scoring 41+ would get "D" because 41 is also β‰₯33, and IF stops at the first TRUE condition.

Section 5.2

AND, OR, NOT β€” Combining Conditions

AND Function

πŸ“ Formula Syntax
=AND(logical1, logical2, ...)
Returns TRUE only if ALL arguments are TRUE. If any argument is FALSE, the entire result is FALSE. Think of it as "ALL conditions must be met."

Example 1 β€” Eligibility for Merit Scholarship

Student needs BOTH: marks β‰₯ 90 AND attendance β‰₯ 85%:

=AND(B2>=90, C2>=85)

StudentMarksAttendance %AND Result
Aarti9288TRUE βœ…
Ravi9572FALSE ❌ (attendance low)
Seema7891FALSE ❌ (marks low)

Example 2 β€” Loan Approval (Bank)

SBI loan requires: Age 21-60, Income β‰₯ β‚Ή25,000/month, Credit Score β‰₯ 700:

=AND(B2>=21, B2<=60, C2>=25000, D2>=700)

Example 3 β€” IF + AND Combination

=IF(AND(B2>=90, C2>=85), "Scholarship", "Not Eligible")

If both conditions met β†’ "Scholarship", otherwise β†’ "Not Eligible"

OR Function

πŸ“ Formula Syntax
=OR(logical1, logical2, ...)
Returns TRUE if ANY argument is TRUE. Returns FALSE only if ALL arguments are FALSE. Think of it as "at least ONE condition must be met."

Example 1 β€” Weekend Check

=OR(A2="Saturday", A2="Sunday")

Returns TRUE if the day is Saturday OR Sunday

Example 2 β€” Discount Eligibility

Customer gets discount if EITHER: member = "Yes" OR purchase > β‚Ή5,000:

=IF(OR(B2="Yes", C2>5000), "10% Discount", "No Discount")

Example 3 β€” Emergency Leave Approval

Auto-approve if reason is "Medical" OR "Family Emergency":

=IF(OR(C2="Medical", C2="Family Emergency"), "Auto Approved", "Needs Manager Approval")

NOT Function

πŸ“ Formula Syntax
=NOT(logical)
Reverses the logic. NOT(TRUE) = FALSE, NOT(FALSE) = TRUE. Useful for "everything except" scenarios.

Example 1 β€” Not in Specific Department

=NOT(B2="HR") β€” returns TRUE for everyone NOT in HR.

Example 2 β€” Combine with IF

=IF(NOT(C2="Completed"), "Pending", "Done")

Example 3 β€” Complex Combination

Approve if: (Rating β‰₯ 4 OR Experience β‰₯ 5 years) AND NOT from Intern category:

=IF(AND(OR(C2>=4, D2>=5), NOT(E2="Intern")), "Approved", "Rejected")

You can combine AND, OR, and NOT in any way you want β€” they're like LEGO blocks for logic. =IF(AND(OR(A,B), NOT(C)), "Yes", "No") means: "If (A or B is true) AND C is not true, then Yes."

Real-World Application β€” Employee Bonus Criteria (Infosys-style)

EmployeeDeptYearsRatingAttendance %Bonus Formula
PriyaIT34.592=IF(AND(D2>=4, E2>=85), IF(C2>=5, "20% Bonus", "10% Bonus"), IF(OR(D2>=3, C2>=8), "5% Bonus", "No Bonus"))
RaviSales73.278
AnitaIT54.895
KunalHR22.588

Results: Priya β†’ 10% Bonus (rating β‰₯4, attendance β‰₯85, but years < 5) | Ravi β†’ 5% Bonus (years β‰₯8? No, but rating β‰₯3) | Anita β†’ 20% Bonus (all conditions + 5 years) | Kunal β†’ No Bonus (rating 2.5 < 3 and years 2 < 8)

Section 5.3

IFERROR & SWITCH Functions

IFERROR β€” Error Handling

πŸ“ Formula Syntax
=IFERROR(value, value_if_error)
value: The formula or expression to evaluate. value_if_error: What to return if the formula produces any error (#DIV/0!, #N/A, #VALUE!, #REF!, #NAME?, #NUM!, #NULL!). If no error, returns the normal result.

Example 1 β€” Division by Zero Protection

Calculating per-unit cost when quantity might be 0:

=IFERROR(B2/C2, "N/A")

ProductTotal Cost (β‚Ή)QuantityPer Unit
Pen500100β‚Ή5.00
Notebook12000N/A (instead of #DIV/0!)
Eraser30050β‚Ή6.00

Example 2 β€” VLOOKUP Error Handling

When looking up a product that might not exist:

=IFERROR(VLOOKUP(A2, Products!A:B, 2, FALSE), "Product Not Found")

Returns "Product Not Found" instead of #N/A when no match exists

Example 3 β€” Return 0 Instead of Error

=IFERROR(B2/C2, 0) β€” returns 0 instead of error. Useful when the result feeds into further SUM calculations (errors would propagate otherwise).

Overusing IFERROR: Don't wrap EVERY formula in IFERROR β€” it can hide real errors. If a formula shouldn't produce an error under normal circumstances, leave it unwrapped so bugs surface. Use IFERROR only where errors are expected (like VLOOKUP or division where denominator could be 0).

SWITCH Function

πŸ“ Formula Syntax
=SWITCH(expression, value1, result1, [value2, result2], ..., [default])
Matches an expression against a list of values and returns the corresponding result. If no match is found, returns the default value. Available in Excel 2019+ and Microsoft 365.

Example 1 β€” Department Code Lookup

=SWITCH(B2, "IT", "Information Technology", "HR", "Human Resources", "FIN", "Finance", "MKT", "Marketing", "Unknown")

If B2 = "IT" β†’ "Information Technology" | If B2 = "XYZ" β†’ "Unknown"

Example 2 β€” Day Number to Name

=SWITCH(WEEKDAY(A2), 1,"Sunday", 2,"Monday", 3,"Tuesday", 4,"Wednesday", 5,"Thursday", 6,"Friday", 7,"Saturday")

Example 3 β€” Grade to Grade Point

Convert CBSE grades to grade points:

=SWITCH(C2, "A1",10, "A2",9, "B1",8, "B2",7, "C1",6, "C2",5, "D",4, "E",0)

If C2 = "B1" β†’ 8 grade points

SWITCH vs nested IF: Use SWITCH when you're comparing ONE expression against EXACT values (like department codes, status labels). Use nested IF or IFS when you're comparing against ranges (like marks β‰₯ 90, income ≀ 500000). SWITCH doesn't support range comparisons.

Ctrl + Shift + U β€” Expand/collapse the formula bar

Alt + Enter β€” Insert line break within a cell (useful for long IF formulas)

Ctrl + [ β€” Jump to precedent cells (cells the formula depends on)

F2 β€” Edit mode: highlights all referenced cells in color

Section 5.4

Practice Exercises, MCQs & Interview Questions

Practice Exercises

Exercise 1 β€” Pass/Fail System

Create a marks sheet for 15 students with 5 subjects. A student passes if they score β‰₯33 in EVERY subject. Use IF and AND to determine "Pass" or "Fail" for each student.

Formula: =IF(AND(C2>=33,D2>=33,E2>=33,F2>=33,G2>=33),"Pass","Fail")

Exercise 2 β€” CBSE Grading

For each subject, assign CBSE grades (A1 through E) using nested IF or IFS. Then convert grades to grade points using SWITCH.

Exercise 3 β€” Income Tax Calculator

Create a tax calculator using the new regime slabs. Input: Annual Income. Output: Tax slab, Tax rate, Tax amount, Education cess (4%), Total tax payable. Use nested IF for slab identification.

Hint for total tax calculation: You need to calculate tax on each slab separately, not just apply the rate to the full income. For β‚Ή10,00,000: 0 + 15,000 + 30,000 + 15,000 = β‚Ή60,000.

Exercise 4 β€” Loan Eligibility Checker

Create a loan eligibility tool. Criteria: Age 21-58, Income β‰₯ β‚Ή30,000, CIBIL Score β‰₯ 650, Existing EMIs < 40% of income. Use IF with AND/OR. Show: Eligible/Not Eligible and the reason for rejection.

Exercise 5 β€” Electricity Bill Calculator

Indian domestic electricity slabs: 0-100 units @ β‚Ή2.50, 101-200 @ β‚Ή4.00, 201-300 @ β‚Ή5.50, 301-500 @ β‚Ή7.00, 500+ @ β‚Ή8.50. Use nested IF to calculate the bill amount for any given units consumed.

Exercise 6 β€” Student Report Card

For 20 students: display grade, result (Pass/Fail), eligible for distinction (percentage β‰₯ 75%), scholarship (marks β‰₯90 AND attendance β‰₯85). Handle division errors with IFERROR.

Exercise 7 β€” Employee Performance Review

Categories: Outstanding (rating 5), Excellent (4-4.9), Good (3-3.9), Needs Improvement (2-2.9), PIP (below 2). Bonus: Outstanding 30%, Excellent 20%, Good 10%, Needs Improvement 0%, PIP "Warning". Use IFS.

Exercise 8 β€” Delivery Status Tracker

Map status codes to descriptions using SWITCH: D→Delivered, T→In Transit, P→Processing, R→Returned, C→Cancelled. Combine with IF to flag any order that has been "In Transit" for more than 5 days.

Exercise 9 β€” Multi-Criteria Discount

Customer gets discount if: (Member AND purchase β‰₯ β‚Ή2,000) OR (Non-member AND purchase β‰₯ β‚Ή5,000) OR (Festival sale period). Member discount = 15%, Non-member = 10%, Festival = 20%. Use IF with OR and AND.

Exercise 10 β€” Age-Based Insurance Premium

Calculate premium based on age and smoker status: Age 18-30 β†’ β‚Ή5,000 (non-smoker) / β‚Ή8,000 (smoker). Age 31-45 β†’ β‚Ή8,000 / β‚Ή12,000. Age 46-60 β†’ β‚Ή12,000 / β‚Ή18,000. Age 60+ β†’ β‚Ή20,000 / β‚Ή30,000. Use IF with AND.

Exercise 11 β€” GST Rate Finder

Use SWITCH to assign GST rates by product category: Food Grains→0%, Medicine→5%, Electronics→18%, Luxury→28%, Gold→3%, Services→18%. Then calculate GST amount and total price.

Exercise 12 β€” School Admission Eligibility

Criteria: Age β‰₯ 3 (for nursery), marks β‰₯ 60% (for Class 1+), distance from school ≀ 8km, OR sibling already enrolled. Use AND/OR to determine "Eligible"/"Not Eligible".

MCQ Quiz β€” Chapter 5

Q1

What does =IF(AND(A1>10, B1<5), "Yes", "No") return when A1=15, B1=8?

  1. Yes
  2. No
  3. TRUE
  4. #VALUE!
βœ… b) No. AND requires ALL conditions to be TRUE. A1>10 is TRUE (15>10), but B1<5 is FALSE (8 is not less than 5). Since AND is FALSE, IF returns "No".
Q2

In the formula =IF(B2>=90,"A", IF(B2>=80,"B", IF(B2>=70,"C","F"))), what grade does a score of 80 get?

  1. A
  2. B
  3. C
  4. F
βœ… b) B. 80 is not β‰₯90 (first IF is FALSE), but 80 IS β‰₯80 (second IF is TRUE), so it returns "B".
Q3

What happens if no condition is TRUE in an IFS function and there is no TRUE, default pair?

  1. Returns 0
  2. Returns blank
  3. Returns #N/A error
  4. Returns FALSE
βœ… c) Returns #N/A error. IFS requires at least one condition to be TRUE. Always add TRUE, "default_value" as the last pair to handle the catch-all case.
Q4

Which function would you use to handle a #DIV/0! error gracefully?

  1. ISERROR
  2. IFERROR
  3. IF
  4. ERROR.TYPE
βœ… b) IFERROR. IFERROR catches any error type (#DIV/0!, #N/A, #VALUE!, etc.) and returns a custom value instead. ISERROR only returns TRUE/FALSE but doesn't replace the error.
Q5

What is the key limitation of the SWITCH function compared to nested IF?

  1. SWITCH can't return text values
  2. SWITCH can't handle more than 5 values
  3. SWITCH only matches exact values, not ranges
  4. SWITCH doesn't support a default value
βœ… c) SWITCH only matches exact values, not ranges. You can't write SWITCH(B2, >=90, "A"). It must be exact match: SWITCH(B2, 90, "A"). For ranges, use IF or IFS.

Interview Questions

Q1: How would you implement Indian income tax calculation using Excel formulas?

Answer: I would use a slab-wise calculation approach, not a single nested IF that applies one rate to the entire income. The formula calculates tax on each slab separately:

=IF(B2<=300000, 0,
  IF(B2<=600000, (B2-300000)*0.05,
    IF(B2<=900000, 15000 + (B2-600000)*0.10,
      IF(B2<=1200000, 45000 + (B2-900000)*0.15,
        IF(B2<=1500000, 90000 + (B2-1200000)*0.20,
          150000 + (B2-1500000)*0.30)))))

For β‚Ή10,00,000: 0 + (3,00,000Γ—5%) + (3,00,000Γ—10%) + (1,00,000Γ—15%) = β‚Ή15,000 + β‚Ή30,000 + β‚Ή15,000 = β‚Ή60,000. Then add 4% cess: β‚Ή60,000 Γ— 1.04 = β‚Ή62,400.

Q2: When would you choose IFS over nested IF?

Answer: I choose IFS when: (1) There are many conditions (4+), making nested IF hard to read. (2) Conditions are evaluated top-to-bottom without complex branching. (3) The team uses Excel 2019 or Microsoft 365 (IFS isn't available in older versions). I stick with nested IF when: (1) Backward compatibility is needed. (2) The logic involves nested branching (IF within IF within IF with different paths). (3) Only 2-3 simple conditions exist.

Q3: Explain a scenario where IFERROR could mask a real problem.

Answer: Suppose you have =IFERROR(VLOOKUP(A2, Data!A:D, 5, FALSE), "Not Found"). If someone adds a column to the Data sheet, making the table 5 columns wide when the formula expects column 4, the VLOOKUP might return a #REF! error. IFERROR would show "Not Found" β€” masking the structural error. The user thinks the item doesn't exist, when in reality the formula is broken. Solution: Only use IFERROR for expected errors (like #N/A in lookups), and consider using IFNA instead, which catches only #N/A errors, letting structural errors surface.

Section 5.5

Mini Project & Chapter Summary

🎯 Mini Project: Employee Bonus Calculator

Problem Statement

An Indian IT company (similar to TCS/Infosys) needs an automated bonus calculation system based on multiple criteria.

Dataset

Create data for 25 employees with: Employee ID, Name, Department (IT/Sales/HR/Finance), Years of Service, Performance Rating (1-5), Attendance %, Monthly Salary.

Bonus Rules

CriteriaBonus %
Rating β‰₯ 4.5 AND Attendance β‰₯ 90% AND Years β‰₯ 525% of annual salary
Rating β‰₯ 4 AND Attendance β‰₯ 85%20% of annual salary
Rating β‰₯ 3.5 AND Attendance β‰₯ 80%15% of annual salary
Rating β‰₯ 3 AND Attendance β‰₯ 75%10% of annual salary
Rating β‰₯ 2.55% of annual salary
Rating < 2.5No bonus (β‚Ή0)

Deliverables

  1. Bonus Category: Use nested IF with AND to determine which tier each employee falls into
  2. Bonus Percentage: Show the applicable percentage
  3. Bonus Amount: Calculate β‚Ή amount (Monthly Salary Γ— 12 Γ— Bonus %)
  4. Department Summary: Total bonus pool by department using SUMIF
  5. Error Handling: Use IFERROR for any calculations that might error
  6. Status Labels: Use SWITCH to convert rating numbers to labels (5β†’"Outstanding", 4β†’"Excellent", etc.)
  7. Dashboard: Count employees in each bonus tier using COUNTIF
[Screenshot: Employee Bonus Calculator with all formulas applied and department summary]

πŸ“‹ Chapter 5 Summary β€” Logical Functions

  • IF is the fundamental decision function: test β†’ true_value β†’ false_value
  • Nested IF handles multiple outcomes; always order conditions correctly (highest first or lowest first, consistently)
  • IFS provides a cleaner syntax for multiple conditions (Excel 2019+)
  • AND requires ALL conditions TRUE; OR requires at least ONE TRUE; NOT reverses logic
  • Combine IF + AND/OR for complex eligibility checks (loan approval, bonus criteria)
  • IFERROR catches ALL error types β€” use judiciously to avoid masking bugs
  • SWITCH matches exact values β€” best for code/label lookups, NOT for ranges
  • Real applications: CBSE grading, Indian tax slabs, employee bonuses, loan eligibility

Start with a simple Pass/Fail exercise before introducing nested IF. The CBSE grading example resonates strongly with students. For the tax slab exercise, first explain the concept of marginal taxation (each slab applies only to income in that range, not the entire income). This is a common misconception even among adults. Use flowcharts on the board to visualize nested IF logic. Allocate 3 periods: 1 for basic IF, 1 for AND/OR/nested IF, 1 for the mini project.

Chapter 6

Text Functions

πŸ”€ Cleaning India's Messy Data β€” The Text Function Toolkit

India's data comes in all shapes: "PRIYA SHARMA" vs "priya sharma" vs " Priya Sharma ". Phone numbers as "9876543210" or "+91-98765-43210". PAN numbers embedded in long strings. Aadhaar numbers needing masking. Every company β€” from a Mumbai startup to TCS with 6 lakh employees β€” spends 40-60% of their Excel time cleaning and transforming text data. These functions are your data janitor toolkit.

Data CleaningCRM SystemsAadhaar MaskingPAN Validation

🎯 Learning Objectives

  • Extract substrings with LEFT, RIGHT, MID
  • Join text with CONCATENATE, CONCAT, TEXTJOIN, and the & operator
  • Change case with UPPER, LOWER, PROPER
  • Clean data with TRIM, SUBSTITUTE, FIND, SEARCH
  • Format values with TEXT and convert text to numbers with VALUE
  • Use REPT for text-based charts and EXACT for case-sensitive comparison
Section 6.1

LEFT, RIGHT, MID & LEN β€” Extracting Text

LEFT β€” Extract from the Beginning

πŸ“ Formula Syntax
=LEFT(text, [num_chars])
text: The text string. num_chars (optional, default 1): Number of characters to extract from the left side.

Example 1 β€” Extract State Code from PAN

PAN format: ABCDE1234F. The first 5 characters are alphabets:

=LEFT("BWFPS1234K", 5)

Result: BWFPS

Example 2 β€” Extract First Name

If names are formatted as "Priya Sharma" and you want just the first name:

=LEFT(A2, FIND(" ", A2)-1)

Result: Priya (extracts everything before the first space)

Example 3 β€” Extract STD Code from Phone

Phone "011-26854321": =LEFT(A2, 3)

Result: 011 (Delhi STD code)

RIGHT β€” Extract from the End

πŸ“ Formula Syntax
=RIGHT(text, [num_chars])
Extracts the specified number of characters from the right (end) of a text string.

Example 1 β€” Last 4 Digits of Aadhaar (for Masking)

=RIGHT("7423 8156 9012", 4)

Result: 9012

Example 2 β€” Extract File Extension

=RIGHT("report_2024.xlsx", 4)

Result: xlsx

Example 3 β€” Last Name Extraction

From "Rahul Dravid": =RIGHT(A2, LEN(A2)-FIND(" ",A2))

Result: Dravid

MID β€” Extract from the Middle

πŸ“ Formula Syntax
=MID(text, start_num, num_chars)
start_num: Position to start (1-based). num_chars: Number of characters to extract.

Example 1 β€” Extract Birth Year from Aadhaar Enrolment ID

Enrolment ID format: 1234/56789/01234. Extract the middle segment:

=MID("1234/56789/01234", 6, 5)

Result: 56789

Example 2 β€” Extract Invoice Number

Invoice "INV-2024-00567": extract the year:

=MID("INV-2024-00567", 5, 4)

Result: 2024

Example 3 β€” Mask Aadhaar Number (Show Only Last 4)

Display "XXXX XXXX 9012" for Aadhaar "7423 8156 9012":

="XXXX XXXX " & RIGHT(A2, 4)

Result: XXXX XXXX 9012

LEN β€” Count Characters

πŸ“ Formula Syntax
=LEN(text)
Returns the number of characters in a text string, including spaces.

Example 1 β€” Validate Mobile Number Length

=IF(LEN(A2)=10, "Valid", "Invalid")

If A2 = "9876543210" β†’ "Valid" (10 digits) | If A2 = "98765" β†’ "Invalid"

Example 2 β€” PAN Validation

PAN must be exactly 10 characters: =IF(LEN(A2)=10, "Valid PAN", "Check PAN")

Example 3 β€” Character Count for SMS

=LEN("Your OTP is 456789. Valid for 10 minutes.")

Result: 42 characters

Combine: =IF(LEN(A2)>160, "Over SMS limit!", LEN(A2)&" chars")

The combination =LEFT(A2, FIND(" ",A2)-1) for first name and =RIGHT(A2, LEN(A2)-FIND(" ",A2)) for last name is one of the most useful text formula patterns in Indian data processing. Memorize it!

Section 6.2

CONCATENATE, CONCAT, TEXTJOIN & the & Operator

CONCATENATE / CONCAT β€” Joining Text

πŸ“ Formula Syntax
=CONCATENATE(text1, text2, ...) or =CONCAT(text1, text2, ...)
Joins two or more text strings into one. CONCAT is the newer version that also accepts ranges. The & operator does the same thing: =A1 & " " & B1

Example 1 β€” Full Name from First + Last

A (First Name)B (Last Name)C (Full Name)
RajeshKumar=A2 & " " & B2
AnitaDesai=CONCATENATE(A3, " ", B3)
Rajesh Kumar | Anita Desai

Example 2 β€” Create Email Address

=LOWER(LEFT(A2,1) & B2 & "@company.com")

For Rajesh Kumar β†’ rkumar@company.com

Example 3 β€” Invoice ID Generator

="INV-" & TEXT(TODAY(), "YYYY") & "-" & TEXT(ROW()-1, "00000")

Result: INV-2026-00001

TEXTJOIN β€” Join with Delimiter

πŸ“ Formula Syntax
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
delimiter: The separator (e.g., ", " or " - "). ignore_empty: TRUE to skip blank cells, FALSE to include empty strings. Available in Excel 2019+.

Example 1 β€” Create Full Address

A (House)B (Street)C (City)D (PIN)
42MG RoadBangalore560001

=TEXTJOIN(", ", TRUE, A2, B2, C2, D2)

Result: 42, MG Road, Bangalore, 560001

Example 2 β€” Join with Dash (Skipping Blanks)

If C2 is blank: =TEXTJOIN("-", TRUE, "A", "", "C")

Result: A-C (the empty string is skipped because ignore_empty = TRUE)

Example 3 β€” Join a Range

=TEXTJOIN("; ", TRUE, A2:A10) β€” joins all names from A2 to A10 with semicolons.

SUBSTITUTE β€” Replace Text

πŸ“ Formula Syntax
=SUBSTITUTE(text, old_text, new_text, [instance_num])
Replaces occurrences of old_text with new_text. Optional instance_num specifies which occurrence to replace (default: all).

Example 1 β€” Remove Dashes from Phone Numbers

=SUBSTITUTE("91-98765-43210", "-", "")

Result: 919876543210

Example 2 β€” Replace Department Name

=SUBSTITUTE("IT Department", "IT", "Information Technology")

Result: Information Technology Department

Example 3 β€” Replace Only Second Occurrence

=SUBSTITUTE("a-b-c-d", "-", "|", 2)

Result: a-b|c-d (only the 2nd dash is replaced)
Section 6.3

UPPER, LOWER, PROPER, TRIM, FIND, SEARCH, TEXT, VALUE, REPT & EXACT

Case Conversion Functions

πŸ“ Formula Syntax
=UPPER(text)  |  =LOWER(text)  |  =PROPER(text)
UPPER: Converts all to UPPERCASE. LOWER: all to lowercase. PROPER: First Letter Of Each Word Capitalized.
InputUPPERLOWERPROPER
rajesh kumarRAJESH KUMARrajesh kumarRajesh Kumar
PRIYA SHARMAPRIYA SHARMApriya sharmaPriya Sharma
aMiT jOsHiAMIT JOSHIamit joshiAmit Joshi

Example β€” Clean Imported Employee Names

If names were entered inconsistently: =PROPER(A2) standardizes them all.

TRIM β€” Remove Extra Spaces

πŸ“ Formula Syntax
=TRIM(text)
Removes all leading spaces, trailing spaces, and reduces multiple internal spaces to single spaces. Does NOT remove non-breaking spaces (char 160) β€” use SUBSTITUTE for that.

Example 1 β€” Clean Messy Data

=TRIM(" Rajesh Kumar ")

Result: "Rajesh Kumar"

Example 2 β€” Combine with PROPER

=PROPER(TRIM(" aMiT jOsHi "))

Result: "Amit Joshi" (cleaned AND properly cased)

Example 3 β€” Remove Non-Breaking Spaces

=TRIM(SUBSTITUTE(A2, CHAR(160), " "))

First converts non-breaking spaces to regular spaces, then TRIM cleans them up.

TRIM doesn't remove all invisible characters: Data from web or SAP often contains CHAR(160) (non-breaking space) or CHAR(10) (line break). TRIM only handles regular spaces (CHAR(32)). Use =CLEAN(TRIM(SUBSTITUTE(A2,CHAR(160)," "))) for thorough cleaning.

FIND & SEARCH β€” Locate Text Position

πŸ“ Formula Syntax
=FIND(find_text, within_text, [start_num])  |  =SEARCH(find_text, within_text, [start_num])
FIND is case-sensitive. SEARCH is case-insensitive and supports wildcards (* and ?). Both return the position number of the first occurrence.

Example 1 β€” Find Space Position (for Name Splitting)

=FIND(" ", "Sachin Tendulkar")

Result: 7 (the space is at position 7)

Example 2 β€” Case-Insensitive Search

=SEARCH("excel", "Microsoft Excel Training")

Result: 11 (SEARCH ignores case, finds "Excel" at position 11)

Example 3 β€” Check if Text Contains a Word

=IF(ISNUMBER(SEARCH("Delhi", A2)), "Delhi Branch", "Other")

Checks if the address in A2 contains "Delhi" (case-insensitive)

TEXT β€” Format Values as Text

πŸ“ Formula Syntax
=TEXT(value, format_text)
Converts a number or date to text in a specified format. Extremely useful for creating readable labels and reports.

Common Format Codes

FormulaResultUse Case
=TEXT(1234567, "##,##,##0")12,34,567Indian number format (lakhs)
=TEXT(0.185, "0.0%")18.5%Percentage display
=TEXT(TODAY(), "DD-MMM-YYYY")22-Jun-2026Date formatting
=TEXT(TODAY(), "DDDD")MondayDay name
=TEXT(45, "000")045Leading zeros

Example β€” Indian Currency Format

="β‚Ή" & TEXT(1543267, "##,##,##0.00")

Result: β‚Ή15,43,267.00

VALUE β€” Convert Text to Number

πŸ“ Formula Syntax
=VALUE(text)
Converts a text string that looks like a number into an actual number. Essential when importing data where numbers are stored as text.

Example β€” Convert Text-Formatted Numbers

Cell A2 contains "12345" as text (left-aligned, green triangle): =VALUE(A2)

Result: 12345 (now a true number, right-aligned)

REPT β€” Repeat Text

πŸ“ Formula Syntax
=REPT(text, number_times)
Repeats a text string a specified number of times. Great for creating in-cell bar charts!

Example β€” In-Cell Bar Chart

=REPT("β–ˆ", B2/10) β€” if B2=75, displays 7.5 β†’ 7 blocks: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

Example β€” Star Rating Display

=REPT("β˜…", C2) & REPT("β˜†", 5-C2)

If C2=3 β†’ β˜…β˜…β˜…β˜†β˜† | If C2=5 β†’ β˜…β˜…β˜…β˜…β˜…

EXACT β€” Case-Sensitive Comparison

πŸ“ Formula Syntax
=EXACT(text1, text2)
Returns TRUE if text1 and text2 are exactly the same (including case). "Excel" and "excel" would return FALSE.

Example β€” Password Validation

=EXACT(B2, "SecurePass@123")

TRUE only if B2 is exactly "SecurePass@123" β€” "securepass@123" returns FALSE

Ctrl + H β€” Find & Replace dialog (similar to SUBSTITUTE but interactive)

Ctrl + 1 β€” Format Cells dialog (for number/text formatting)

Ctrl + Shift + ~ β€” Apply General number format

Ctrl + E β€” Flash Fill (automatically fills patterns β€” magic for text splitting!)

Flash Fill (Ctrl+E) was introduced in Excel 2013 and can often do what LEFT/RIGHT/MID/CONCATENATE do β€” just by giving it one or two examples! Type "Rajesh" next to "Rajesh Kumar", then press Ctrl+E, and Excel fills the rest of the column with first names automatically.

Section 6.4

Practice Exercises, MCQs & Interview Questions

Practice Exercises

Exercise 1 β€” Name Splitting

Given a list of 15 full names (e.g., "Virat Kohli", "MS Dhoni", "Rohit Sharma"), extract First Name and Last Name into separate columns.

First Name: =LEFT(A2, FIND(" ",A2)-1)

Last Name: =RIGHT(A2, LEN(A2)-FIND(" ",A2))

Exercise 2 β€” Email Generator

From employee data (First Name, Last Name, Company Domain), generate email addresses in the format: first.last@domain.com (all lowercase).

=LOWER(B2 & "." & C2 & "@" & D2)

Exercise 3 β€” Phone Number Formatting

Given 10-digit numbers like 9876543210, format as: +91-98765-43210

="+91-" & LEFT(A2,5) & "-" & RIGHT(A2,5)

Exercise 4 β€” PAN Card Extraction

From a text like "PAN: ABCDE1234F, DOB: 15/08/1990", extract: (a) PAN number, (b) 4th character of PAN (entity type), (c) Validate PAN length.

Exercise 5 β€” Aadhaar Masking

Given Aadhaar numbers, display masked format: XXXX XXXX 1234. Also validate that the original has exactly 12 digits (excluding spaces).

="XXXX XXXX " & RIGHT(SUBSTITUTE(A2," ",""),4)

Exercise 6 β€” Data Cleaning Challenge

Given messy data: " rAjEsH kUMAR " β†’ clean to "Rajesh Kumar". Combine PROPER, TRIM, and SUBSTITUTE.

Exercise 7 β€” Address Standardization

Standardize addresses: replace "Rd" with "Road", "St" with "Street", "Blvd" with "Boulevard". Remove extra spaces.

Exercise 8 β€” Indian Currency Formatting

Convert numbers to Indian format with β‚Ή symbol: 1234567 β†’ "β‚Ή12,34,567". Use TEXT function.

Exercise 9 β€” In-Cell Rating System

Create a star rating system: for ratings 1-5, display filled and empty stars using REPT.

Exercise 10 β€” GSTIN Breakdown

GSTIN format: 27AABCU9603R1ZM (15 chars). Extract: State Code (first 2), PAN (chars 3-12), Entity Number (char 13), Z (char 14), Checksum (char 15).

State Code: =LEFT(A2,2) | PAN: =MID(A2,3,10)

Exercise 11 β€” Word Count

Count words in a sentence: =LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))+1

Exercise 12 β€” CSV Builder

Use TEXTJOIN to create CSV-formatted rows from data columns. Join 5 columns with commas, handling blank cells.

MCQ Quiz β€” Chapter 6

Q1

What is the difference between FIND and SEARCH?

  1. FIND works with numbers, SEARCH works with text
  2. FIND is case-sensitive, SEARCH is case-insensitive
  3. FIND returns text, SEARCH returns a number
  4. They are identical functions
βœ… b) FIND is case-sensitive, SEARCH is case-insensitive. Additionally, SEARCH supports wildcards (* and ?), while FIND does not.
Q2

What does =TRIM(" Hello World ") return?

  1. "HelloWorld"
  2. "Hello World"
  3. " Hello World "
  4. "Hello World"
βœ… b) "Hello World". TRIM removes leading/trailing spaces AND reduces multiple internal spaces to a single space.
Q3

What does =MID("ABCDE1234F", 6, 4) return?

  1. E123
  2. 1234
  3. DE12
  4. 234F
βœ… b) 1234. MID starts at position 6 (which is "1") and extracts 4 characters: "1234".
Q4

What does =TEXT(45678, "##,##,##0") produce?

  1. 45,678
  2. 4,56,78
  3. 45,678
  4. 4,5,6,7,8
βœ… a) 45,678. The Indian number format ##,##,##0 applies grouping from right-to-left in groups of 2 after the first group of 3. For 45678, it shows 45,678.
Q5

What is the purpose of the VALUE function?

  1. Converts a number to text
  2. Returns the monetary value of a cell
  3. Converts text that looks like a number into an actual number
  4. Returns the absolute value of a number
βœ… c) Converts text that looks like a number into an actual number. This is essential when importing data from external systems where numbers are stored as left-aligned text strings.

Interview Questions

Q1: How would you extract the domain name from an email address in Excel?

Answer: I'd use a combination of MID, FIND, and LEN:

=MID(A2, FIND("@",A2)+1, LEN(A2)-FIND("@",A2))

For "priya.sharma@infosys.com": FIND("@") returns 13. MID starts at position 14 and extracts (23-13) = 10 characters β†’ "infosys.com".

Alternative with RIGHT: =RIGHT(A2, LEN(A2)-FIND("@",A2))

Q2: You receive a dataset where names are entered inconsistently (mixed case, extra spaces). How would you clean it?

Answer: I'd use a multi-step cleaning formula:

=PROPER(TRIM(SUBSTITUTE(SUBSTITUTE(A2, CHAR(160), " "), CHAR(10), " ")))

Step 1: SUBSTITUTE(A2, CHAR(160), " ") β€” replace non-breaking spaces.
Step 2: SUBSTITUTE(..., CHAR(10), " ") β€” remove line breaks.
Step 3: TRIM β€” remove leading/trailing and multiple internal spaces.
Step 4: PROPER β€” capitalize first letter of each word.

For bulk cleaning, I'd also consider Flash Fill (Ctrl+E) β€” just type the correct version of the first name, and Flash Fill detects the pattern.

Q3: How can you count the number of words in a cell?

Answer: Words are separated by spaces, so word count = number of spaces + 1. The formula is:

=LEN(TRIM(A2)) - LEN(SUBSTITUTE(TRIM(A2), " ", "")) + 1

How it works: TRIM(A2) cleans the text. LEN counts total characters. SUBSTITUTE removes all spaces. The difference gives the number of spaces. Add 1 because "n" words have "n-1" spaces between them. For "Hello World" β†’ 11 - 10 + 1 = 2 words.

Edge case: If cell is blank, this returns 1 (incorrect). Fix: =IF(LEN(TRIM(A2))=0, 0, LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))+1)

Section 6.5

Mini Project & Chapter Summary

🎯 Mini Project: Data Cleaning Tool

Problem Statement

A company imported employee data from an old system. The data is messy and needs cleaning before it can be used in the HR portal.

Messy Dataset (20 rows)

Raw NameRaw PhoneRaw EmailRaw City
  rAjEsH   kUMAR  91-98765-43210RAJESH@COMPANY.COM  delhi  
PRIYA  SHARMA+919876543211priya.sharma@Company.ComMUMBAI
aMiT   joshi9876543212amit.joshi@company.combangalore

Deliverables β€” Clean Output Columns

  1. Clean Name: =PROPER(TRIM(A2)) β†’ "Rajesh Kumar"
  2. First Name: =LEFT(Clean_Name, FIND(" ",Clean_Name)-1)
  3. Last Name: =RIGHT(Clean_Name, LEN(Clean_Name)-FIND(" ",Clean_Name))
  4. Clean Phone: Remove all dashes and +91 prefix, format as 10-digit: =RIGHT(SUBSTITUTE(SUBSTITUTE(B2,"-",""),"+91",""),10)
  5. Formatted Phone: ="+91-" & LEFT(Clean_Phone,5) & "-" & RIGHT(Clean_Phone,5)
  6. Clean Email: =LOWER(TRIM(C2))
  7. Clean City: =PROPER(TRIM(D2))
  8. Employee ID: Generate "EMP-001" format: ="EMP-" & TEXT(ROW()-1, "000")
  9. Validation: Phone is 10 digits? Name has space (first+last)? Email contains "@"?
  10. Summary: Count of invalid phones, duplicate emails, city distribution
[Screenshot: Before and After comparison of messy vs cleaned data]

πŸ“‹ Chapter 6 Summary β€” Text Functions

  • LEFT, RIGHT, MID extract substrings by position; combine with FIND for dynamic extraction
  • LEN counts characters β€” essential for validation (PAN=10, mobile=10, Aadhaar=12)
  • CONCATENATE/CONCAT/& join text; TEXTJOIN adds delimiters and handles blanks
  • UPPER, LOWER, PROPER standardize case; PROPER is most useful for names
  • TRIM removes extra spaces; combine with SUBSTITUTE(CHAR(160)) for thorough cleaning
  • FIND (case-sensitive) and SEARCH (case-insensitive) locate text positions
  • TEXT formats numbers/dates as display strings; VALUE converts text to numbers
  • REPT creates text-based charts; EXACT does case-sensitive comparison
  • Key pattern: First name = LEFT(A2, FIND(" ",A2)-1); Last name = RIGHT(A2, LEN(A2)-FIND(" ",A2))
  • Ctrl+E (Flash Fill) can often replace complex text formulas

Text functions are best taught with a live data cleaning exercise. Import a messy CSV file and clean it column by column. Students find this deeply satisfying β€” they can see the "before" and "after" immediately. The Aadhaar masking and PAN extraction examples connect to real Indian scenarios they'll encounter. Emphasize Flash Fill (Ctrl+E) as the modern alternative, but ensure they understand the formulas first. Allocate 2-3 periods with plenty of hands-on practice.

Chapter 7

Date & Time Functions

πŸ“… Every Indian Office Runs on Dates β€” Master Them

Employee age for Aadhaar, years of service for gratuity, CBSE exam countdowns, EMI due dates, project deadlines, leave calculations, retirement dates β€” date arithmetic is everywhere in Indian offices. Yet dates are one of the most confusing topics in Excel because Excel stores dates as serial numbers (January 1, 1900 = 1). Understanding this internal representation is the key to mastering date functions.

HR PayrollProject ManagementBanking EMICBSE Scheduling

🎯 Learning Objectives

  • Understand Excel's date serial number system
  • Use TODAY() and NOW() for dynamic dates
  • Construct dates with DATE() and extract parts with DAY, MONTH, YEAR
  • Calculate differences with DATEDIF and DAYS
  • Navigate months with EDATE and EOMONTH
  • Calculate working days with NETWORKDAYS and WORKDAY
  • Apply date functions to Indian scenarios: age calculation, tenure, retirement, EMI dates

Understanding Excel's Date System

Excel stores every date as a serial number. January 1, 1900 = 1. January 2, 1900 = 2. Today (June 22, 2026) is serial number 46,189. This is why you can add and subtract dates β€” they're just numbers underneath.

DateSerial Number
01-Jan-19001
15-Aug-1947 (Independence Day)17,394
01-Jan-200036,526
22-Jun-2026 (Today)46,189

Times are stored as decimal fractions of a day: 12:00 PM = 0.5, 6:00 AM = 0.25, 6:00 PM = 0.75.

Excel has a famous bug: it treats 1900 as a leap year (February 29, 1900 exists in Excel but never existed in reality). This was inherited from Lotus 1-2-3 for backward compatibility. It means all dates before March 1, 1900 are off by one day!

Section 7.1

TODAY, NOW & DATE Functions

TODAY() β€” Current Date

πŸ“ Formula Syntax
=TODAY()
Returns the current date (no arguments needed). Updates automatically every time the worksheet recalculates. Stored as a serial number but displayed as a date.

Example 1 β€” Days Until CBSE Board Exam

If board exams start on 15-Feb-2027:

=DATE(2027,2,15) - TODAY()

Result: 238 days (as of 22-Jun-2026)

Example 2 β€” Employee's Age in Years

DOB: 15-Mar-1990: =INT((TODAY()-DATE(1990,3,15))/365.25)

Result: 36 years (approximate β€” use DATEDIF for exact)

Example 3 β€” Is It Due Today?

=IF(A2=TODAY(), "DUE TODAY!", IF(A2<TODAY(), "OVERDUE", "Upcoming"))

NOW() β€” Current Date & Time

πŸ“ Formula Syntax
=NOW()
Returns the current date AND time. Updates on every recalculation. Useful for timestamps.

Example 1 β€” Timestamp a Log Entry

=TEXT(NOW(), "DD-MMM-YYYY HH:MM:SS AM/PM")

Result: 22-Jun-2026 06:40:30 PM

Example 2 β€” Hours Since Last Update

=(NOW()-A2)*24 β€” where A2 contains the last update datetime

Result: Hours elapsed since A2's timestamp

Example 3 β€” Current Time Only

=NOW()-TODAY() β€” returns only the time portion (as a decimal)

Format as time to see: 6:40 PM

TODAY() and NOW() keep changing: These are volatile functions β€” they recalculate every time anything changes in the workbook. If you need a fixed date/time stamp, press Ctrl+; for current date or Ctrl+Shift+; for current time (these insert static values, not formulas).

DATE() β€” Construct a Date

πŸ“ Formula Syntax
=DATE(year, month, day)
Creates a date from individual year, month, and day numbers. Extremely useful when date components are in separate cells or need calculation.

Example 1 β€” Construct Date from Separate Cells

A2=2026, B2=8, C2=15: =DATE(A2, B2, C2)

Result: 15-Aug-2026 (Independence Day!)

Example 2 β€” First Day of Current Month

=DATE(YEAR(TODAY()), MONTH(TODAY()), 1)

Result: 01-Jun-2026

Example 3 β€” Last Day of Previous Month

=DATE(YEAR(TODAY()), MONTH(TODAY()), 0)

Result: 31-May-2026 (day 0 of current month = last day of previous month!)

DAY, MONTH, YEAR β€” Extract Components

πŸ“ Formula Syntax
=DAY(date)  |  =MONTH(date)  |  =YEAR(date)
Extract the day (1-31), month (1-12), or year from a date value.
DateDAY()MONTH()YEAR()
15-Aug-20261582026
26-Jan-20272612027
02-Oct-18692101869

Practical Use β€” Group Sales by Month

=MONTH(A2) extracts the month number, which you can use with SUMIF to sum sales by month.

HOUR, MINUTE, SECOND β€” Time Components

πŸ“ Formula Syntax
=HOUR(time)  |  =MINUTE(time)  |  =SECOND(time)
Extract hour (0-23), minute (0-59), or second (0-59) from a time value.

Example β€” Extract Shift from Login Time

=IF(HOUR(A2)<12, "Morning Shift", IF(HOUR(A2)<20, "Day Shift", "Night Shift"))

WEEKDAY β€” Day of the Week

πŸ“ Formula Syntax
=WEEKDAY(serial_number, [return_type])
return_type: 1 (default) = Sunday=1 to Saturday=7. 2 = Monday=1 to Sunday=7. 3 = Monday=0 to Sunday=6.

Example 1 β€” Is It a Weekend?

=IF(OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7), "Weekend", "Weekday")

Example 2 β€” Day Name

=TEXT(A2, "DDDD")

If A2 = 15-Aug-2026 β†’ "Saturday"

Example 3 β€” Next Monday

=A2 + (9 - WEEKDAY(A2, 2)) β€” calculates the next Monday from any date.

Ctrl + ; β€” Insert current date (static, not a formula)

Ctrl + Shift + ; β€” Insert current time (static)

Ctrl + Shift + # β€” Apply Date format (DD-MMM-YY)

Ctrl + Shift + @ β€” Apply Time format (HH:MM AM/PM)

Section 7.2

DATEDIF, DAYS, EDATE & EOMONTH

DATEDIF β€” Date Difference (The Hidden Gem)

πŸ“ Formula Syntax
=DATEDIF(start_date, end_date, unit)
unit: "Y" = complete years, "M" = complete months, "D" = days, "YM" = months after subtracting years, "MD" = days after subtracting months, "YD" = days after subtracting years. Note: DATEDIF is undocumented β€” it doesn't appear in Excel's autocomplete, but it works!

Example 1 β€” Calculate Exact Age

DOB: 10-Mar-1990. As of today (22-Jun-2026):

=DATEDIF("10-Mar-1990", TODAY(), "Y") β†’ 36 years

=DATEDIF("10-Mar-1990", TODAY(), "YM") β†’ 3 months

=DATEDIF("10-Mar-1990", TODAY(), "MD") β†’ 12 days

Complete age string:

=DATEDIF(A2,TODAY(),"Y") & " years, " & DATEDIF(A2,TODAY(),"YM") & " months, " & DATEDIF(A2,TODAY(),"MD") & " days"

Result: 36 years, 3 months, 12 days

Example 2 β€” Employee Tenure for Gratuity

Gratuity is payable after 5 years of continuous service in India:

EmployeeJoining DateYears of ServiceGratuity Eligible?
Ramesh15-Jan-2018=DATEDIF(B2,TODAY(),"Y")=IF(C2>=5,"Yes","No")
Sunita03-Aug-2022=DATEDIF(B3,TODAY(),"Y")=IF(C3>=5,"Yes","No")

Ramesh: 8 years β†’ Yes | Sunita: 3 years β†’ No

Example 3 β€” Aadhaar Age Verification

Minimum age for Aadhaar enrollment is 0 (even newborns can get it), but for certain services, age must be β‰₯ 18:

=IF(DATEDIF(A2, TODAY(), "Y")>=18, "Adult - Full Services", "Minor - Limited Services")

DATEDIF is one of Excel's most useful functions, yet Microsoft has never officially documented it! It was inherited from Lotus 1-2-3. It doesn't appear in the formula autocomplete list, and you won't find it in the Insert Function dialog. But it works perfectly in all versions of Excel.

DAYS β€” Simple Day Difference

πŸ“ Formula Syntax
=DAYS(end_date, start_date)
Returns the number of days between two dates. Note: end_date comes FIRST (opposite of DATEDIF). You can also simply subtract: =end_date - start_date.

Example 1 β€” Project Duration

=DAYS("31-Dec-2026", "01-Apr-2026")

Result: 274 days

Example 2 β€” Days Since Last Order

=DAYS(TODAY(), B2) where B2 = last order date

Example 3 β€” Simple Subtraction Alternative

=DATE(2027,3,31) - DATE(2026,4,1)

Result: 364 days (same as DAYS but using subtraction)

EDATE β€” Move by Months

πŸ“ Formula Syntax
=EDATE(start_date, months)
Returns a date that is a specified number of months before (negative) or after (positive) the start_date. The day stays the same unless the target month has fewer days.

Example 1 β€” EMI Due Date (6 Months from Disbursement)

Loan disbursed: 15-Jan-2026. First EMI after 6 months:

=EDATE("15-Jan-2026", 6)

Result: 15-Jul-2026

Example 2 β€” Passport Renewal Date

Passport issued: 20-May-2016. Valid for 10 years (120 months):

=EDATE("20-May-2016", 120)

Result: 20-May-2026 (time to renew!)

Example 3 β€” Go Back 3 Months

=EDATE(TODAY(), -3)

Result: 22-Mar-2026 (3 months before today)

EOMONTH β€” End of Month

πŸ“ Formula Syntax
=EOMONTH(start_date, months)
Returns the last day of the month that is the specified number of months before or after start_date. Use months=0 for end of current month.

Example 1 β€” Salary Credit Date (Last Working Day)

=EOMONTH(TODAY(), 0)

Result: 30-Jun-2026 (last day of current month)

Example 2 β€” Invoice Due Date (End of Next Month)

=EOMONTH(A2, 1) β€” if A2 is invoice date, payment is due by end of next month.

Example 3 β€” Last Day of Previous Month

=EOMONTH(TODAY(), -1)

Result: 31-May-2026

31st of the month issues: When using EDATE with dates on the 31st, Excel adjusts automatically. EDATE("31-Jan-2026", 1) returns 28-Feb-2026 (not 31-Feb, which doesn't exist). This is correct behavior, but can cause confusion when tracking monthly deadlines. Use EOMONTH instead if you always want the month-end date.

Section 7.3

NETWORKDAYS & WORKDAY β€” Working Day Calculations

NETWORKDAYS β€” Count Working Days

πŸ“ Formula Syntax
=NETWORKDAYS(start_date, end_date, [holidays])
Returns the number of working days (Mon-Fri) between two dates, excluding weekends. Optionally exclude specific holidays from a list.

Example 1 β€” Working Days in a Quarter

=NETWORKDAYS("01-Apr-2026", "30-Jun-2026")

Result: 65 working days (excludes Saturdays and Sundays)

Example 2 β€” With Indian Holidays

Create a holidays list: 26-Jan (Republic Day), 15-Aug (Independence Day), 02-Oct (Gandhi Jayanti), Diwali, Holi, etc.

Holiday DateHoliday Name
26-Jan-2026Republic Day
10-Mar-2026Holi
14-Apr-2026Dr. Ambedkar Jayanti
01-May-2026May Day
15-Aug-2026Independence Day
02-Oct-2026Gandhi Jayanti
20-Oct-2026Diwali
25-Dec-2026Christmas

=NETWORKDAYS("01-Jan-2026", "31-Dec-2026", HolidayList)

Result: ~253 working days (261 weekdays minus 8 holidays that fall on weekdays)

Example 3 β€” Project Timeline

Project start: 01-Jul-2026. End: 30-Sep-2026. How many actual working days?

=NETWORKDAYS("01-Jul-2026", "30-Sep-2026", Holidays!A2:A10)

Result: ~63 working days (excluding weekends and holidays)

WORKDAY β€” Find a Future/Past Working Day

πŸ“ Formula Syntax
=WORKDAY(start_date, days, [holidays])
Returns the date that is the specified number of working days before (negative) or after (positive) the start_date. Skips weekends and holidays.

Example 1 β€” Project Deadline (45 Working Days)

Project starts: 01-Jul-2026. Deadline in 45 working days:

=WORKDAY("01-Jul-2026", 45)

Result: 01-Sep-2026 (approximately β€” skips weekends)

Example 2 β€” SLA Deadline (5 Business Days)

Customer complaint received: 15-Jun-2026. Must resolve in 5 business days:

=WORKDAY("15-Jun-2026", 5)

Result: 22-Jun-2026 (Mon 15, Tue 16, Wed 17, Thu 18, Fri 19 = 5 days β†’ next Mon 22)

Example 3 β€” Go Back 10 Working Days

=WORKDAY(TODAY(), -10)

Result: 08-Jun-2026 (10 business days before today, excluding weekends)

For companies with Saturday as a working day (common in Indian government offices and some private firms), use NETWORKDAYS.INTL instead. It lets you specify which days are weekends: =NETWORKDAYS.INTL(start, end, "0000001", holidays) β€” here "0000001" means only Sunday is a weekend.

Date Arithmetic β€” Practical Scenarios

Calculate Retirement Date

In India, government retirement age is 60. If DOB is in A2:

=DATE(YEAR(A2)+60, MONTH(A2), DAY(A2))

If A2 = 15-Mar-1966 β†’ Retirement: 15-Mar-2026

Calculate Next Birthday

=IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))>=TODAY(), DATE(YEAR(TODAY()),MONTH(A2),DAY(A2)), DATE(YEAR(TODAY())+1,MONTH(A2),DAY(A2)))

This checks if this year's birthday has passed. If not, shows this year's date; otherwise, next year's.

Days Until Next Birthday

Wrap the above in: =NextBirthday - TODAY()

EMI Payment Schedule

For a 12-month EMI starting from disbursement date:

=EDATE(DisbursementDate, ROW()-1) β€” generates the 1st, 2nd, 3rd... EMI dates when dragged down.

Dates confuse students because of format vs. value differences. Demonstrate by entering a date, then formatting the cell as "Number" β€” they'll see the serial number. This "aha moment" makes all date arithmetic click. Also show how entering "15/08/2026" in one system might mean Aug 15 or Mar 8 depending on regional settings. Always use DATE() function for unambiguous date creation.

Section 7.4

Practice Exercises, MCQs & Interview Questions

Practice Exercises

Exercise 1 β€” Age Calculator

Create an age calculator: input DOB, output age in "X years, Y months, Z days" format using DATEDIF. Test with: (a) 15-Aug-1990, (b) 01-Jan-2000, (c) 25-Dec-1975.

Exercise 2 β€” CBSE Exam Countdown

Create a countdown dashboard showing days remaining until 5 exam dates. Use conditional formatting: Red if < 30 days, Yellow if 30-60, Green if > 60.

Exercise 3 β€” Employee Tenure Report

For 15 employees with joining dates, calculate: years of service, eligible for gratuity (5+ years), eligible for long service award (10+ years), retirement date (age 60).

Exercise 4 β€” Loan EMI Schedule

Loan disbursement: 01-Apr-2026, Tenure: 24 months. Generate all 24 EMI dates using EDATE. Mark which fall on weekends using WEEKDAY and show the adjusted date using WORKDAY.

Exercise 5 β€” Holiday Planner

List all Indian national holidays for 2026. Calculate total working days per month using NETWORKDAYS. Create a summary table: Month, Total Days, Working Days, Holidays, Weekends.

Exercise 6 β€” Project Timeline

Project has 5 phases, each requiring 15, 20, 10, 25, and 30 working days respectively. Start: 01-Jul-2026. Calculate start and end date of each phase using WORKDAY. Include Indian holidays.

Exercise 7 β€” Birthday Tracker

For 20 friends/family: Name, DOB. Calculate: Current age, Next birthday date, Days until next birthday, Day of the week their next birthday falls on. Sort by upcoming birthday.

Exercise 8 β€” Month-End Reporting

Using EOMONTH, generate a list of all month-end dates for 2026. Then calculate NETWORKDAYS between consecutive month-ends.

Exercise 9 β€” Date Extraction Challenge

Given dates, extract: Day, Month number, Month name (using TEXT), Year, Quarter (using CEILING(MONTH/3,1)), Day name. Create a date dimension table.

Exercise 10 β€” SLA Tracking

10 customer complaints with: Received Date, Priority (High=2 days, Medium=5 days, Low=10 days). Calculate: SLA Deadline (using WORKDAY), Current Status (Open/Closed), Days Overdue (if any).

Exercise 11 β€” Passport/License Renewal Tracker

Track 10 documents: Name, Document Type, Issue Date, Validity (years). Calculate: Expiry Date (EDATE), Days Until Expiry, Status (Valid/Expiring Soon/Expired), Renewal Date (30 days before expiry).

Exercise 12 β€” Fiscal Year Calculator

Indian fiscal year: April to March. Given any date, determine: (a) Which FY it belongs to (e.g., "FY 2026-27"), (b) Quarter (Q1=Apr-Jun, Q2=Jul-Sep, Q3=Oct-Dec, Q4=Jan-Mar), (c) Days remaining in current FY.

Hint for FY: =IF(MONTH(A2)>=4, "FY "&YEAR(A2)&"-"&RIGHT(YEAR(A2)+1,2), "FY "&YEAR(A2)-1&"-"&RIGHT(YEAR(A2),2))

MCQ Quiz β€” Chapter 7

Q1

How does Excel internally store the date 01-Jan-2000?

  1. As the text "01-Jan-2000"
  2. As the serial number 36526
  3. As a date object
  4. As 2000-01-01 in ISO format
βœ… b) As the serial number 36526. Excel stores all dates as serial numbers starting from January 1, 1900 (= 1). This is why date arithmetic works β€” dates are just numbers underneath.
Q2

What does =EOMONTH("15-Jun-2026", 0) return?

  1. 15-Jun-2026
  2. 30-Jun-2026
  3. 01-Jul-2026
  4. 01-Jun-2026
βœ… b) 30-Jun-2026. EOMONTH with months=0 returns the last day of the same month as the start_date. June has 30 days.
Q3

Which function should you use to calculate exact age in years, months, and days?

  1. DAYS
  2. EDATE
  3. DATEDIF
  4. NETWORKDAYS
βœ… c) DATEDIF. Use DATEDIF with "Y" for years, "YM" for remaining months, "MD" for remaining days. DAYS only gives total day count, not broken into years/months/days.
Q4

What does NETWORKDAYS exclude by default?

  1. Only Sundays
  2. Saturdays and Sundays
  3. All public holidays
  4. Only the dates in the holidays argument
βœ… b) Saturdays and Sundays. NETWORKDAYS automatically excludes Saturdays and Sundays. Public holidays are excluded only if you provide them in the optional holidays argument. For custom weekend definitions, use NETWORKDAYS.INTL.
Q5

What is the difference between =TODAY() and pressing Ctrl+;?

  1. They produce the same result
  2. TODAY() updates automatically; Ctrl+; is a static value
  3. Ctrl+; gives time too; TODAY() gives only date
  4. TODAY() works only in formulas; Ctrl+; works anywhere
βœ… b) TODAY() updates automatically on every recalculation; Ctrl+; inserts a static date value that never changes. Use TODAY() for dynamic calculations (age, days until deadline). Use Ctrl+; for timestamps (date of data entry).

Interview Questions

Q1: How would you calculate an employee's eligibility for gratuity in India using Excel?

Answer: Under the Payment of Gratuity Act, an employee is eligible after 5 years of continuous service. I'd use:

=DATEDIF(JoiningDate, TODAY(), "Y") to get years of service.

Then: =IF(DATEDIF(B2,TODAY(),"Y")>=5, "Eligible", "Not Eligible")

For gratuity amount: =IF(Years>=5, (LastSalary*15*Years)/26, 0)

Where 15 = days per year, 26 = working days per month. For an employee with 10 years service and β‚Ή50,000 last drawn salary: (50,000 Γ— 15 Γ— 10) / 26 = β‚Ή2,88,462.

Q2: A company has Saturday as a working day. How would you calculate working days?

Answer: Use NETWORKDAYS.INTL instead of NETWORKDAYS. The second argument accepts a weekend string where each digit represents a day (Mon-Sun), 1 = non-working, 0 = working:

=NETWORKDAYS.INTL("01-Jan-2026", "31-Dec-2026", "0000001", Holidays)

"0000001" means only Sunday (the 7th position) is a weekend. Alternatively, use weekend number 11 which also means "Sunday only":

=NETWORKDAYS.INTL("01-Jan-2026", "31-Dec-2026", 11, Holidays)

For a company with alternate Saturdays off, you'd need to create a custom holidays list that includes the non-working Saturdays.

Q3: How do you determine which Indian fiscal year a given date belongs to?

Answer: India's fiscal year runs from April 1 to March 31. If the month is April (4) or later, the FY starts in that calendar year. If the month is January-March, the FY started in the previous calendar year.

=IF(MONTH(A2)>=4, "FY "&YEAR(A2)&"-"&RIGHT(YEAR(A2)+1,2), "FY "&(YEAR(A2)-1)&"-"&RIGHT(YEAR(A2),2))

For 15-Nov-2026: Month=11 (β‰₯4), so FY 2026-27.
For 20-Feb-2027: Month=2 (<4), so FY 2026-27.
For 05-Apr-2027: Month=4 (β‰₯4), so FY 2027-28.

For the fiscal quarter: =IF(MONTH(A2)>=4, CEILING((MONTH(A2)-3)/3, 1), CEILING((MONTH(A2)+9)/3, 1))

Section 7.5

Mini Project & Chapter Summary

🎯 Mini Project: Employee Age & Tenure Calculator

Problem Statement

Create a comprehensive Employee Age & Tenure Dashboard for an Indian company with 25 employees.

Dataset Columns

Employee ID, Name, Date of Birth, Date of Joining, Department, Monthly Salary

Calculated Columns (Deliverables)

  1. Current Age (Years, Months, Days): Using DATEDIF with "Y", "YM", "MD" β€” display as "32 years, 5 months, 14 days"
  2. Age in Years (decimal): =DATEDIF(DOB,TODAY(),"Y") + DATEDIF(DOB,TODAY(),"YM")/12
  3. Tenure (Years, Months, Days): Same DATEDIF approach with joining date
  4. Retirement Date: =DATE(YEAR(DOB)+60, MONTH(DOB), DAY(DOB))
  5. Days Until Retirement: =RetirementDate - TODAY()
  6. Retirement Year: =YEAR(RetirementDate)
  7. Gratuity Eligible: =IF(DATEDIF(JoiningDate,TODAY(),"Y")>=5, "Yes", "No")
  8. Gratuity Amount: =IF(Eligible, (Salary*15*Years)/26, 0)
  9. Next Birthday: Calculate the next upcoming birthday
  10. Days Until Next Birthday: =NextBirthday - TODAY()
  11. Working Days Until Retirement: =NETWORKDAYS(TODAY(), RetirementDate, Holidays)
  12. Birth Day Name: =TEXT(DOB, "DDDD") β€” what day of the week were they born?

Summary Dashboard

  • Average age of workforce
  • Average tenure
  • Count of employees retiring in next 5 years
  • Total gratuity liability (β‚Ή)
  • Department-wise average age
  • Youngest and oldest employee
  • Next birthday in the company (closest upcoming)
[Screenshot: Complete Employee Age & Tenure Dashboard with all calculated columns and summary statistics]

πŸ“‹ Chapter 7 Summary β€” Date & Time Functions

  • Excel stores dates as serial numbers (1 = 01-Jan-1900) and times as decimal fractions (0.5 = noon)
  • TODAY() returns current date (dynamic); Ctrl+; inserts static date
  • NOW() returns current date+time; Ctrl+Shift+; for static time
  • DATE(year, month, day) constructs dates; use day=0 for last day of previous month
  • DAY, MONTH, YEAR extract date components; HOUR, MINUTE, SECOND for time
  • DATEDIF (undocumented!) calculates differences in Y/M/D/YM/MD/YD β€” perfect for age calculation
  • DAYS returns simple day count between dates (or just subtract dates)
  • EDATE adds/subtracts months; EOMONTH finds month-end dates
  • NETWORKDAYS counts working days (Mon-Fri); WORKDAY finds a future working date
  • Use NETWORKDAYS.INTL for custom weekend definitions (Saturday-working offices)
  • WEEKDAY returns day number; TEXT(date, "DDDD") returns day name
  • Indian applications: age for Aadhaar, tenure for gratuity, FY determination, EMI schedules

The biggest "aha moment" comes when students format a date cell as "Number" and see the serial number. Do this first. Then date arithmetic makes intuitive sense β€” it's just number subtraction. DATEDIF is the star of this chapter β€” spend extra time on it. The retirement date and gratuity calculation examples connect directly to students' parents' work lives, making it personal and memorable. For the mini project, provide a template with 25 rows of sample data so students can focus on writing formulas, not data entry. Allocate 2-3 periods.

Coming Up Next: Part III β€” Lookup & Reference Functions

You now command 40+ essential Excel functions across math, logic, text, and dates. But real-world data often sits in different tables β€” a product list here, prices there, customer details elsewhere. In Part III, you'll master the lookup superpowers: VLOOKUP (the classic), HLOOKUP, INDEX-MATCH (the professional choice), and the revolutionary XLOOKUP. You'll build an automated invoice generator, a student report card that pulls data from multiple sheets, and a dynamic sales dashboard β€” all powered by lookup functions. These are the functions that separate a casual Excel user from a true professional.