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
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,MAXfor basic calculations - Apply
ROUND,ROUNDUP,ROUNDDOWNfor precision control - Understand
ABS,MOD, andPOWERfor advanced math - Master conditional functions:
SUMIF,COUNTIF,AVERAGEIFand their multi-criteria variants - Use
INT,CEILING,FLOORfor rounding variations - Solve 40+ real-world problems using mathematical functions
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.
=SUM(number1, [number2], ...)
Example 1 β Sum a Simple Range (Monthly Sales)
A Flipkart seller wants to know total sales for Q1 (JanuaryβMarch):
| A | B |
|---|---|
| Month | Sales (βΉ) |
| January | 1,25,000 |
| February | 1,48,000 |
| March | 1,62,000 |
Formula in B5: =SUM(B2:B4)
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:
| A | B |
|---|---|
| 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.
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)
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.
=AVERAGE(number1, [number2], ...)
Example 1 β Class Average (CBSE School)
A teacher at Delhi Public School wants to find the average Mathematics marks for 5 students:
| A | B |
|---|---|
| Student | Maths Marks |
| Aarav | 87 |
| Priya | 92 |
| Rahul | 76 |
| Sneha | 95 |
| Vikram | 83 |
Formula in B7: =AVERAGE(B2:B6)
Calculation: (87 + 92 + 76 + 95 + 83) Γ· 5 = 433 Γ· 5 = 86.6
Example 2 β Average Monthly Sales (Zomato Delivery Partner)
| Month | Orders Delivered |
|---|---|
| Jan | 342 |
| Feb | 298 |
| Mar | 376 |
| Apr | 415 |
| May | 389 |
| Jun | 401 |
Formula: =AVERAGE(B2:B7)
Example 3 β Average with Non-Contiguous Cells
Average only the first and last exam scores: =AVERAGE(B2, B6)
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.
MIN, MAX & ROUND Functions
The MIN Function
=MIN(number1, [number2], ...)
Example 1 β Lowest Marks in Class
| Student | Science |
|---|---|
| Aisha | 78 |
| Rohan | 54 |
| Kavya | 91 |
| Dev | 67 |
| Meera | 82 |
Formula: =MIN(B2:B6)
Example 2 β Lowest Salary in Department
HR at Wipro wants to find the minimum CTC in the Engineering department:
| Employee | CTC (βΉ LPA) |
|---|---|
| Amit | 6.5 |
| Pooja | 8.2 |
| Karthik | 5.8 |
| Ritu | 12.1 |
Formula: =MIN(B2:B5)
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
=MAX(number1, [number2], ...)
Example 1 β Highest Marks (Topper)
Using the same student data above: =MAX(B2:B6)
Example 2 β Peak Daily Sales
| Day | Sales (βΉ) |
|---|---|
| Monday | 45,200 |
| Tuesday | 38,900 |
| Wednesday | 52,100 |
| Thursday | 41,600 |
| Friday | 67,800 |
| Saturday | 78,400 |
Formula: =MAX(B2:B7)
Example 3 β Difference Between Highest & Lowest (Range)
=MAX(B2:B7) - MIN(B2:B7)
The ROUND Function Family
=ROUND(number, num_digits)
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)
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)
Example 3 β ROUNDDOWN for Conservative Estimates
=ROUNDDOWN(3.789, 2)
Round to Nearest 10, 100, 1000
| Formula | Result | Explanation |
|---|---|---|
=ROUND(15847, -1) | 15850 | Nearest 10 |
=ROUND(15847, -2) | 15800 | Nearest 100 |
=ROUND(15847, -3) | 16000 | Nearest 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.
ABS, MOD & POWER Functions
ABS β Absolute Value
=ABS(number)
Example 1 β Budget Variance
Budgeted: βΉ5,00,000. Actual: βΉ5,43,000. What's the absolute difference?
=ABS(500000 - 543000)
Example 2 β Temperature Difference
=ABS(-4 - 8)
Example 3 β Stock Price Movement
Opening: βΉ2,340. Closing: βΉ2,298. Absolute change: =ABS(2340-2298)
MOD β Remainder After Division
=MOD(number, divisor)
Example 1 β Check Odd or Even
Is roll number 247 odd or even?
=MOD(247, 2)
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
Example 3 β Remaining Items After Packaging
A factory has 1,247 chocolates. Each box holds 12. How many left over?
=MOD(1247, 12)
POWER β Exponentiation
=POWER(number, power)
^ 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)
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)
Example 3 β Population Growth
India's population 140 crore, growing at 0.7% per year. After 10 years:
=140 * POWER(1.007, 10)
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
=INT(number) | =CEILING(number, significance) | =FLOOR(number, significance)
| Formula | Result | What It Does |
|---|---|---|
=INT(7.8) | 7 | Drops decimals, rounds toward zero |
=INT(-7.8) | -8 | Rounds toward negative infinity |
=CEILING(42, 5) | 45 | Next multiple of 5 above 42 |
=CEILING(123, 50) | 150 | Next multiple of 50 |
=FLOOR(42, 5) | 40 | Previous multiple of 5 below 42 |
=FLOOR(123, 50) | 100 | Previous 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
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)
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
=SUMIF(range, criteria, [sum_range])
| A | B | C |
|---|---|---|
| Product | Region | Sales (βΉ) |
| Laptop | North | 2,50,000 |
| Phone | South | 1,80,000 |
| Laptop | South | 3,10,000 |
| Tablet | North | 95,000 |
| Phone | North | 2,20,000 |
| Laptop | West | 2,75,000 |
Example 1 β Sum All Laptop Sales
=SUMIF(A2:A7, "Laptop", C2:C7)
Example 2 β Sum Sales from North Region
=SUMIF(B2:B7, "North", C2:C7)
Example 3 β Sum Sales Greater Than βΉ2,00,000
=SUMIF(C2:C7, ">200000")
SUMIFS β Multiple Criteria
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Example β Laptop Sales in North Region Only
=SUMIFS(C2:C7, A2:A7, "Laptop", B2:B7, "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
=COUNTIF(range, criteria)
Example 1 β Count Students Who Passed (β₯33)
| Student | Marks |
|---|---|
| Amit | 45 |
| Neha | 28 |
| Raj | 72 |
| Sunita | 31 |
| Deepak | 89 |
| Fatima | 55 |
=COUNTIF(B2:B7, ">=33")
Example 2 β Count Specific Product
=COUNTIF(A2:A7, "Phone") (from sales data above)
Example 3 β Count Blank Cells
=COUNTIF(A2:A20, "")
COUNTIFS β Multiple Conditions
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Example β Count Laptops Sold in North
=COUNTIFS(A2:A7, "Laptop", B2:B7, "North")
AVERAGEIF & AVERAGEIFS
=AVERAGEIF(range, criteria, [average_range])
Example 1 β Average Salary of Engineers
| Employee | Department | Salary (βΉ) |
|---|---|---|
| Aman | Engineering | 75,000 |
| Priya | Marketing | 55,000 |
| Karan | Engineering | 82,000 |
| Divya | HR | 48,000 |
| Suresh | Engineering | 91,000 |
=AVERAGEIF(B2:B6, "Engineering", C2:C6)
Example 2 β Average Marks Above 60
=AVERAGEIF(B2:B7, ">60")
Example 3 β AVERAGEIFS with Multiple Criteria
=AVERAGEIFS(C2:C6, B2:B6, "Engineering", C2:C6, ">70000")
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.
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
What does =SUMIF(A1:A10, ">50") do?
- Sums all values in A1:A10
- Sums values greater than 50 in A1:A10
- Counts values greater than 50
- Returns an error because sum_range is missing
What is the result of =MOD(17, 5)?
- 3
- 2
- 3.4
- 5
In SUMIFS, where does the sum_range argument appear?
- Last argument
- Second argument
- First argument
- It doesn't exist in SUMIFS
What does =ROUND(2.555, 2) return?
- 2.55
- 2.56
- 2.6
- 3
If A1=10 and A2 is blank, what does =AVERAGE(A1, A2) return?
- 5
- 10
- #DIV/0!
- 0
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.
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
- Total Marks: Use
SUMto calculate total marks for each student (out of 500) - Percentage: Calculate percentage using
=SUM()/5andROUNDto 2 decimals - Class Average:
AVERAGEof each subject column - Subject Topper:
MAXfor each subject - Lowest Score:
MINfor each subject - Pass Count:
COUNTIFβ count students scoring β₯33 in each subject - Fail Count:
COUNTIFβ count students scoring <33 - Distinction Count:
COUNTIFβ count students with percentage β₯75% - First Division:
COUNTIFβ 60% to 74.99% - Average of Passed Students:
AVERAGEIFβ average marks of students who scored β₯33 in each subject - Total Marks of Top Scorers:
SUMIFβ sum total marks of students with percentage β₯90% - Subject-wise Analysis Table: Summary table with Subject, Average, Max, Min, Pass%, Fail%
π Chapter 4 Summary β Mathematical Functions
SUMadds numbers; supports ranges, non-contiguous cells, and 3D references across sheetsAVERAGEcalculates arithmetic mean; ignores blanks but includes zerosMIN/MAXfind smallest/largest values in a rangeROUND,ROUNDUP,ROUNDDOWNcontrol decimal precision; negative num_digits round to tens/hundredsABSreturns absolute value β useful for variance calculationsMODreturns remainder β use for odd/even checks, batch sizingPOWER(or^) calculates exponents β compound interest, growth projectionsINTtruncates to integer;CEILINGrounds up to multiple;FLOORrounds down to multipleSUMIF/SUMIFSsum conditionally β note the different argument order!COUNTIF/COUNTIFScount cells matching conditionsAVERAGEIF/AVERAGEIFScalculate 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.
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
IFstatements for single-condition decisions - Build nested IF formulas for multi-level grading and tax slabs
- Use
IFSas a cleaner alternative to nested IF - Combine conditions with
AND,OR,NOT - Handle errors gracefully with
IFERROR - Use
SWITCHfor value-based matching - Apply logical functions to real Indian scenarios: tax, grading, loan eligibility
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.
=IF(logical_test, value_if_true, value_if_false)
Example 1 β Pass / Fail (CBSE)
In CBSE, minimum passing marks = 33 out of 100:
| A | B | C |
|---|---|---|
| Student | Marks | Result |
| Arjun | 78 | =IF(B2>=33,"Pass","Fail") |
| Meena | 25 | =IF(B3>=33,"Pass","Fail") |
| Vishal | 33 | =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")
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)
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.
=IF(condition1, result1, IF(condition2, result2, IF(condition3, result3, default_result)))
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)
| Student | Marks | Grade Formula |
|---|---|---|
| Priya | 95 | =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"))))))) |
| Raj | 72 | |
| Sunita | 45 | |
| Deepak | 28 |
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 Slab | Tax Rate |
|---|---|
| Up to βΉ3,00,000 | Nil |
| βΉ3,00,001 β βΉ6,00,000 | 5% |
| βΉ6,00,001 β βΉ9,00,000 | 10% |
| βΉ9,00,001 β βΉ12,00,000 | 15% |
| βΉ12,00,001 β βΉ15,00,000 | 20% |
| Above βΉ15,00,000 | 30% |
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 Value | Discount |
|---|---|
| Above βΉ5,000 | 20% |
| βΉ3,000 β βΉ5,000 | 15% |
| βΉ1,000 β βΉ2,999 | 10% |
| Below βΉ1,000 | 5% |
=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
=IFS(condition1, value1, condition2, value2, ..., TRUE, default_value)
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.
AND, OR, NOT β Combining Conditions
AND Function
=AND(logical1, logical2, ...)
Example 1 β Eligibility for Merit Scholarship
Student needs BOTH: marks β₯ 90 AND attendance β₯ 85%:
=AND(B2>=90, C2>=85)
| Student | Marks | Attendance % | AND Result |
|---|---|---|---|
| Aarti | 92 | 88 | TRUE β |
| Ravi | 95 | 72 | FALSE β (attendance low) |
| Seema | 78 | 91 | FALSE β (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")
OR Function
=OR(logical1, logical2, ...)
Example 1 β Weekend Check
=OR(A2="Saturday", A2="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
=NOT(logical)
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)
| Employee | Dept | Years | Rating | Attendance % | Bonus Formula |
|---|---|---|---|---|---|
| Priya | IT | 3 | 4.5 | 92 | =IF(AND(D2>=4, E2>=85), IF(C2>=5, "20% Bonus", "10% Bonus"), IF(OR(D2>=3, C2>=8), "5% Bonus", "No Bonus")) |
| Ravi | Sales | 7 | 3.2 | 78 | |
| Anita | IT | 5 | 4.8 | 95 | |
| Kunal | HR | 2 | 2.5 | 88 |
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)
IFERROR & SWITCH Functions
IFERROR β Error Handling
=IFERROR(value, value_if_error)
Example 1 β Division by Zero Protection
Calculating per-unit cost when quantity might be 0:
=IFERROR(B2/C2, "N/A")
| Product | Total Cost (βΉ) | Quantity | Per Unit |
|---|---|---|---|
| Pen | 500 | 100 | βΉ5.00 |
| Notebook | 1200 | 0 | N/A (instead of #DIV/0!) |
| Eraser | 300 | 50 | βΉ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")
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
=SWITCH(expression, value1, result1, [value2, result2], ..., [default])
Example 1 β Department Code Lookup
=SWITCH(B2, "IT", "Information Technology", "HR", "Human Resources", "FIN", "Finance", "MKT", "Marketing", "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)
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
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
What does =IF(AND(A1>10, B1<5), "Yes", "No") return when A1=15, B1=8?
- Yes
- No
- TRUE
- #VALUE!
In the formula =IF(B2>=90,"A", IF(B2>=80,"B", IF(B2>=70,"C","F"))), what grade does a score of 80 get?
- A
- B
- C
- F
What happens if no condition is TRUE in an IFS function and there is no TRUE, default pair?
- Returns 0
- Returns blank
- Returns #N/A error
- Returns FALSE
TRUE, "default_value" as the last pair to handle the catch-all case.Which function would you use to handle a #DIV/0! error gracefully?
- ISERROR
- IFERROR
- IF
- ERROR.TYPE
What is the key limitation of the SWITCH function compared to nested IF?
- SWITCH can't return text values
- SWITCH can't handle more than 5 values
- SWITCH only matches exact values, not ranges
- SWITCH doesn't support a default value
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.
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
| Criteria | Bonus % |
|---|---|
| Rating β₯ 4.5 AND Attendance β₯ 90% AND Years β₯ 5 | 25% 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.5 | 5% of annual salary |
| Rating < 2.5 | No bonus (βΉ0) |
Deliverables
- Bonus Category: Use nested IF with AND to determine which tier each employee falls into
- Bonus Percentage: Show the applicable percentage
- Bonus Amount: Calculate βΉ amount (Monthly Salary Γ 12 Γ Bonus %)
- Department Summary: Total bonus pool by department using SUMIF
- Error Handling: Use IFERROR for any calculations that might error
- Status Labels: Use SWITCH to convert rating numbers to labels (5β"Outstanding", 4β"Excellent", etc.)
- Dashboard: Count employees in each bonus tier using COUNTIF
π Chapter 5 Summary β Logical Functions
IFis the fundamental decision function: test β true_value β false_value- Nested IF handles multiple outcomes; always order conditions correctly (highest first or lowest first, consistently)
IFSprovides a cleaner syntax for multiple conditions (Excel 2019+)ANDrequires ALL conditions TRUE;ORrequires at least ONE TRUE;NOTreverses logic- Combine IF + AND/OR for complex eligibility checks (loan approval, bonus criteria)
IFERRORcatches ALL error types β use judiciously to avoid masking bugsSWITCHmatches 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.
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
TEXTand convert text to numbers withVALUE - Use
REPTfor text-based charts andEXACTfor case-sensitive comparison
LEFT, RIGHT, MID & LEN β Extracting Text
LEFT β Extract from the Beginning
=LEFT(text, [num_chars])
Example 1 β Extract State Code from PAN
PAN format: ABCDE1234F. The first 5 characters are alphabets:
=LEFT("BWFPS1234K", 5)
Example 2 β Extract First Name
If names are formatted as "Priya Sharma" and you want just the first name:
=LEFT(A2, FIND(" ", A2)-1)
Example 3 β Extract STD Code from Phone
Phone "011-26854321": =LEFT(A2, 3)
RIGHT β Extract from the End
=RIGHT(text, [num_chars])
Example 1 β Last 4 Digits of Aadhaar (for Masking)
=RIGHT("7423 8156 9012", 4)
Example 2 β Extract File Extension
=RIGHT("report_2024.xlsx", 4)
Example 3 β Last Name Extraction
From "Rahul Dravid": =RIGHT(A2, LEN(A2)-FIND(" ",A2))
MID β Extract from the Middle
=MID(text, start_num, num_chars)
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)
Example 2 β Extract Invoice Number
Invoice "INV-2024-00567": extract the year:
=MID("INV-2024-00567", 5, 4)
Example 3 β Mask Aadhaar Number (Show Only Last 4)
Display "XXXX XXXX 9012" for Aadhaar "7423 8156 9012":
="XXXX XXXX " & RIGHT(A2, 4)
LEN β Count Characters
=LEN(text)
Example 1 β Validate Mobile Number Length
=IF(LEN(A2)=10, "Valid", "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.")
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!
CONCATENATE, CONCAT, TEXTJOIN & the & Operator
CONCATENATE / CONCAT β Joining Text
=CONCATENATE(text1, text2, ...) or =CONCAT(text1, text2, ...)
& operator does the same thing: =A1 & " " & B1Example 1 β Full Name from First + Last
| A (First Name) | B (Last Name) | C (Full Name) |
|---|---|---|
| Rajesh | Kumar | =A2 & " " & B2 |
| Anita | Desai | =CONCATENATE(A3, " ", B3) |
Example 2 β Create Email Address
=LOWER(LEFT(A2,1) & B2 & "@company.com")
Example 3 β Invoice ID Generator
="INV-" & TEXT(TODAY(), "YYYY") & "-" & TEXT(ROW()-1, "00000")
TEXTJOIN β Join with Delimiter
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
Example 1 β Create Full Address
| A (House) | B (Street) | C (City) | D (PIN) |
|---|---|---|---|
| 42 | MG Road | Bangalore | 560001 |
=TEXTJOIN(", ", TRUE, A2, B2, C2, D2)
Example 2 β Join with Dash (Skipping Blanks)
If C2 is blank: =TEXTJOIN("-", TRUE, "A", "", "C")
Example 3 β Join a Range
=TEXTJOIN("; ", TRUE, A2:A10) β joins all names from A2 to A10 with semicolons.
SUBSTITUTE β Replace Text
=SUBSTITUTE(text, old_text, new_text, [instance_num])
Example 1 β Remove Dashes from Phone Numbers
=SUBSTITUTE("91-98765-43210", "-", "")
Example 2 β Replace Department Name
=SUBSTITUTE("IT Department", "IT", "Information Technology")
Example 3 β Replace Only Second Occurrence
=SUBSTITUTE("a-b-c-d", "-", "|", 2)
UPPER, LOWER, PROPER, TRIM, FIND, SEARCH, TEXT, VALUE, REPT & EXACT
Case Conversion Functions
=UPPER(text) | =LOWER(text) | =PROPER(text)
| Input | UPPER | LOWER | PROPER |
|---|---|---|---|
| rajesh kumar | RAJESH KUMAR | rajesh kumar | Rajesh Kumar |
| PRIYA SHARMA | PRIYA SHARMA | priya sharma | Priya Sharma |
| aMiT jOsHi | AMIT JOSHI | amit joshi | Amit Joshi |
Example β Clean Imported Employee Names
If names were entered inconsistently: =PROPER(A2) standardizes them all.
TRIM β Remove Extra Spaces
=TRIM(text)
Example 1 β Clean Messy Data
=TRIM(" Rajesh Kumar ")
Example 2 β Combine with PROPER
=PROPER(TRIM(" aMiT jOsHi "))
Example 3 β Remove Non-Breaking Spaces
=TRIM(SUBSTITUTE(A2, CHAR(160), " "))
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
=FIND(find_text, within_text, [start_num]) | =SEARCH(find_text, within_text, [start_num])
Example 1 β Find Space Position (for Name Splitting)
=FIND(" ", "Sachin Tendulkar")
Example 2 β Case-Insensitive Search
=SEARCH("excel", "Microsoft Excel Training")
Example 3 β Check if Text Contains a Word
=IF(ISNUMBER(SEARCH("Delhi", A2)), "Delhi Branch", "Other")
TEXT β Format Values as Text
=TEXT(value, format_text)
Common Format Codes
| Formula | Result | Use Case |
|---|---|---|
=TEXT(1234567, "##,##,##0") | 12,34,567 | Indian number format (lakhs) |
=TEXT(0.185, "0.0%") | 18.5% | Percentage display |
=TEXT(TODAY(), "DD-MMM-YYYY") | 22-Jun-2026 | Date formatting |
=TEXT(TODAY(), "DDDD") | Monday | Day name |
=TEXT(45, "000") | 045 | Leading zeros |
Example β Indian Currency Format
="βΉ" & TEXT(1543267, "##,##,##0.00")
VALUE β Convert Text to Number
=VALUE(text)
Example β Convert Text-Formatted Numbers
Cell A2 contains "12345" as text (left-aligned, green triangle): =VALUE(A2)
REPT β Repeat Text
=REPT(text, number_times)
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)
EXACT β Case-Sensitive Comparison
=EXACT(text1, text2)
Example β Password Validation
=EXACT(B2, "SecurePass@123")
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.
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
What is the difference between FIND and SEARCH?
- FIND works with numbers, SEARCH works with text
- FIND is case-sensitive, SEARCH is case-insensitive
- FIND returns text, SEARCH returns a number
- They are identical functions
What does =TRIM(" Hello World ") return?
- "HelloWorld"
- "Hello World"
- " Hello World "
- "Hello World"
What does =MID("ABCDE1234F", 6, 4) return?
- E123
- 1234
- DE12
- 234F
What does =TEXT(45678, "##,##,##0") produce?
- 45,678
- 4,56,78
- 45,678
- 4,5,6,7,8
What is the purpose of the VALUE function?
- Converts a number to text
- Returns the monetary value of a cell
- Converts text that looks like a number into an actual number
- Returns the absolute value of a number
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)
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 Name | Raw Phone | Raw Email | Raw City |
|---|---|---|---|
| rAjEsH kUMAR | 91-98765-43210 | RAJESH@COMPANY.COM | delhi |
| PRIYA SHARMA | +919876543211 | priya.sharma@Company.Com | MUMBAI |
| aMiT joshi | 9876543212 | amit.joshi@company.com | bangalore |
Deliverables β Clean Output Columns
- Clean Name:
=PROPER(TRIM(A2))β "Rajesh Kumar" - First Name:
=LEFT(Clean_Name, FIND(" ",Clean_Name)-1) - Last Name:
=RIGHT(Clean_Name, LEN(Clean_Name)-FIND(" ",Clean_Name)) - Clean Phone: Remove all dashes and +91 prefix, format as 10-digit:
=RIGHT(SUBSTITUTE(SUBSTITUTE(B2,"-",""),"+91",""),10) - Formatted Phone:
="+91-" & LEFT(Clean_Phone,5) & "-" & RIGHT(Clean_Phone,5) - Clean Email:
=LOWER(TRIM(C2)) - Clean City:
=PROPER(TRIM(D2)) - Employee ID: Generate "EMP-001" format:
="EMP-" & TEXT(ROW()-1, "000") - Validation: Phone is 10 digits? Name has space (first+last)? Email contains "@"?
- Summary: Count of invalid phones, duplicate emails, city distribution
π Chapter 6 Summary β Text Functions
LEFT,RIGHT,MIDextract substrings by position; combine with FIND for dynamic extractionLENcounts characters β essential for validation (PAN=10, mobile=10, Aadhaar=12)CONCATENATE/CONCAT/&join text;TEXTJOINadds delimiters and handles blanksUPPER,LOWER,PROPERstandardize case;PROPERis most useful for namesTRIMremoves extra spaces; combine with SUBSTITUTE(CHAR(160)) for thorough cleaningFIND(case-sensitive) andSEARCH(case-insensitive) locate text positionsTEXTformats numbers/dates as display strings;VALUEconverts text to numbersREPTcreates text-based charts;EXACTdoes 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.
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()andNOW()for dynamic dates - Construct dates with
DATE()and extract parts withDAY,MONTH,YEAR - Calculate differences with
DATEDIFandDAYS - Navigate months with
EDATEandEOMONTH - Calculate working days with
NETWORKDAYSandWORKDAY - 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.
| Date | Serial Number |
|---|---|
| 01-Jan-1900 | 1 |
| 15-Aug-1947 (Independence Day) | 17,394 |
| 01-Jan-2000 | 36,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!
TODAY, NOW & DATE Functions
TODAY() β Current Date
=TODAY()
Example 1 β Days Until CBSE Board Exam
If board exams start on 15-Feb-2027:
=DATE(2027,2,15) - TODAY()
Example 2 β Employee's Age in Years
DOB: 15-Mar-1990: =INT((TODAY()-DATE(1990,3,15))/365.25)
Example 3 β Is It Due Today?
=IF(A2=TODAY(), "DUE TODAY!", IF(A2<TODAY(), "OVERDUE", "Upcoming"))
NOW() β Current Date & Time
=NOW()
Example 1 β Timestamp a Log Entry
=TEXT(NOW(), "DD-MMM-YYYY HH:MM:SS AM/PM")
Example 2 β Hours Since Last Update
=(NOW()-A2)*24 β where A2 contains the last update datetime
Example 3 β Current Time Only
=NOW()-TODAY() β returns only the time portion (as a decimal)
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
=DATE(year, month, day)
Example 1 β Construct Date from Separate Cells
A2=2026, B2=8, C2=15: =DATE(A2, B2, C2)
Example 2 β First Day of Current Month
=DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
Example 3 β Last Day of Previous Month
=DATE(YEAR(TODAY()), MONTH(TODAY()), 0)
DAY, MONTH, YEAR β Extract Components
=DAY(date) | =MONTH(date) | =YEAR(date)
| Date | DAY() | MONTH() | YEAR() |
|---|---|---|---|
| 15-Aug-2026 | 15 | 8 | 2026 |
| 26-Jan-2027 | 26 | 1 | 2027 |
| 02-Oct-1869 | 2 | 10 | 1869 |
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
=HOUR(time) | =MINUTE(time) | =SECOND(time)
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
=WEEKDAY(serial_number, [return_type])
Example 1 β Is It a Weekend?
=IF(OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7), "Weekend", "Weekday")
Example 2 β Day Name
=TEXT(A2, "DDDD")
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)
DATEDIF, DAYS, EDATE & EOMONTH
DATEDIF β Date Difference (The Hidden Gem)
=DATEDIF(start_date, end_date, unit)
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"
Example 2 β Employee Tenure for Gratuity
Gratuity is payable after 5 years of continuous service in India:
| Employee | Joining Date | Years of Service | Gratuity Eligible? |
|---|---|---|---|
| Ramesh | 15-Jan-2018 | =DATEDIF(B2,TODAY(),"Y") | =IF(C2>=5,"Yes","No") |
| Sunita | 03-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
=DAYS(end_date, start_date)
Example 1 β Project Duration
=DAYS("31-Dec-2026", "01-Apr-2026")
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)
EDATE β Move by Months
=EDATE(start_date, months)
Example 1 β EMI Due Date (6 Months from Disbursement)
Loan disbursed: 15-Jan-2026. First EMI after 6 months:
=EDATE("15-Jan-2026", 6)
Example 2 β Passport Renewal Date
Passport issued: 20-May-2016. Valid for 10 years (120 months):
=EDATE("20-May-2016", 120)
Example 3 β Go Back 3 Months
=EDATE(TODAY(), -3)
EOMONTH β End of Month
=EOMONTH(start_date, months)
Example 1 β Salary Credit Date (Last Working Day)
=EOMONTH(TODAY(), 0)
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)
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.
NETWORKDAYS & WORKDAY β Working Day Calculations
NETWORKDAYS β Count Working Days
=NETWORKDAYS(start_date, end_date, [holidays])
Example 1 β Working Days in a Quarter
=NETWORKDAYS("01-Apr-2026", "30-Jun-2026")
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 Date | Holiday Name |
|---|---|
| 26-Jan-2026 | Republic Day |
| 10-Mar-2026 | Holi |
| 14-Apr-2026 | Dr. Ambedkar Jayanti |
| 01-May-2026 | May Day |
| 15-Aug-2026 | Independence Day |
| 02-Oct-2026 | Gandhi Jayanti |
| 20-Oct-2026 | Diwali |
| 25-Dec-2026 | Christmas |
=NETWORKDAYS("01-Jan-2026", "31-Dec-2026", HolidayList)
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)
WORKDAY β Find a Future/Past Working Day
=WORKDAY(start_date, days, [holidays])
Example 1 β Project Deadline (45 Working Days)
Project starts: 01-Jul-2026. Deadline in 45 working days:
=WORKDAY("01-Jul-2026", 45)
Example 2 β SLA Deadline (5 Business Days)
Customer complaint received: 15-Jun-2026. Must resolve in 5 business days:
=WORKDAY("15-Jun-2026", 5)
Example 3 β Go Back 10 Working Days
=WORKDAY(TODAY(), -10)
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))
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.
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
How does Excel internally store the date 01-Jan-2000?
- As the text "01-Jan-2000"
- As the serial number 36526
- As a date object
- As 2000-01-01 in ISO format
What does =EOMONTH("15-Jun-2026", 0) return?
- 15-Jun-2026
- 30-Jun-2026
- 01-Jul-2026
- 01-Jun-2026
Which function should you use to calculate exact age in years, months, and days?
- DAYS
- EDATE
- DATEDIF
- NETWORKDAYS
What does NETWORKDAYS exclude by default?
- Only Sundays
- Saturdays and Sundays
- All public holidays
- Only the dates in the holidays argument
What is the difference between =TODAY() and pressing Ctrl+;?
- They produce the same result
- TODAY() updates automatically; Ctrl+; is a static value
- Ctrl+; gives time too; TODAY() gives only date
- TODAY() works only in formulas; Ctrl+; works anywhere
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))
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)
- Current Age (Years, Months, Days): Using DATEDIF with "Y", "YM", "MD" β display as "32 years, 5 months, 14 days"
- Age in Years (decimal):
=DATEDIF(DOB,TODAY(),"Y") + DATEDIF(DOB,TODAY(),"YM")/12 - Tenure (Years, Months, Days): Same DATEDIF approach with joining date
- Retirement Date:
=DATE(YEAR(DOB)+60, MONTH(DOB), DAY(DOB)) - Days Until Retirement:
=RetirementDate - TODAY() - Retirement Year:
=YEAR(RetirementDate) - Gratuity Eligible:
=IF(DATEDIF(JoiningDate,TODAY(),"Y")>=5, "Yes", "No") - Gratuity Amount:
=IF(Eligible, (Salary*15*Years)/26, 0) - Next Birthday: Calculate the next upcoming birthday
- Days Until Next Birthday:
=NextBirthday - TODAY() - Working Days Until Retirement:
=NETWORKDAYS(TODAY(), RetirementDate, Holidays) - 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)
π 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 dateNOW()returns current date+time; Ctrl+Shift+; for static timeDATE(year, month, day)constructs dates; use day=0 for last day of previous monthDAY,MONTH,YEARextract date components;HOUR,MINUTE,SECONDfor timeDATEDIF(undocumented!) calculates differences in Y/M/D/YM/MD/YD β perfect for age calculationDAYSreturns simple day count between dates (or just subtract dates)EDATEadds/subtracts months;EOMONTHfinds month-end datesNETWORKDAYScounts working days (Mon-Fri);WORKDAYfinds a future working date- Use
NETWORKDAYS.INTLfor custom weekend definitions (Saturday-working offices) WEEKDAYreturns 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.