Learning Objectives
By the end of this lesson, you will be able to:
- Build nested IF rules with AND and OR for pass, grade, and status bands
- Look up values with VLOOKUP and with INDEX plus MATCH
- Aggregate with SUM, AVERAGE, COUNT, COUNTIF, SUMIF, and AVERAGEIF
- Use math helpers ROUND, ABS, POWER, SQRT and syllabus trig SIN and COS with RADIANS
- Calculate EMI with PMT and tenure with DATEDIF for Nepal business cases
Sample file: employee_payroll.csv
How Functions Group in This Course
Excel groups functions by job. Learn the job first, then the syntax. Each group below ties to a business question you will meet in PRC 110.
| Group | Job | Core Functions | Typical Question |
|---|---|---|---|
| Logical | Decide between outcomes | IF, AND, OR, nested IF | Pass or fail? High or Low? |
| Lookup | Find a value by a key | VLOOKUP, INDEX, MATCH | What is the net for this employee ID? |
| Statistical | Summarise a range | SUM, AVERAGE, COUNT, COUNTIF, SUMIF, AVERAGEIF, MAX, MIN | How many passed? Average salary? |
| Math and trig | Clean numbers and syllabus maths | ROUND, ABS, POWER, SQRT, SIN, COS, RADIANS | Rounded total? Sine of an angle? |
| Financial | Money over time | PMT, FV, PV, RATE | Monthly EMI for a loan? |
| Date and time | Dates and tenure | TODAY, NOW, DATE, DATEDIF, YEAR, MONTH, DAY | Years of service? Age on BS date? |
1) Logical Functions
Pass or fail with AND:
=IF(AND(C2>=50,D2>=50),"Pass","Fail")
Both subjects must reach 50. AND returns true only when every condition holds. OR would pass if either subject reached 50.
Nested IF for revenue bands similar to Model Lab Test style:
=IF(D2>25000,"High",IF(D2>10000,"Medium","Low"))
Read from the top threshold down. Test boundary values exactly at 10,000 and 25,000 to ensure the comparison uses > or >= as the brief requires. When nesting grows deep, prefer a helper column that holds one test per cell, then combine the helpers.
2) Lookup and Reference
Assume table A2:D7 with Product in column 1 and Revenue in column 4, as the course spec states.
Exact VLOOKUP:
=VLOOKUP(B15,A2:D7,4,FALSE)
B15 holds the lookup key, A2:D7 holds the table, 4 is the column to return, FALSE or 0 demands an exact match. Always use exact for names and IDs. Approximate TRUE is for sorted ranges such as tax bands and is rarely needed here.
INDEX plus MATCH - flexible when column order changes:
=INDEX(G2:G9,MATCH(B22,A2:A9,0))
MATCH finds the row number of B22 inside A2:A9. INDEX returns the value from G2:G9 at that row. The 0 means exact match, the same idea as FALSE above. Verify that VLOOKUP and INDEX plus MATCH return the same result for one key before you copy the formula down.
3) Statistical and Conditional Aggregates
| Need | Formula |
|---|---|
| Total units | =SUM(B2:B7) |
| Average revenue | =AVERAGE(D2:D7) |
| Count of High status | =COUNTIF(G2:G7,”High”) |
| Sum revenue where High | =SUMIF(G2:G7,”High”,D2:D7) |
| Average net for IT | =AVERAGEIF(B2:B9,”IT”,G2:G9) |
| Highest revenue | =MAX(D2:D7) |
| Number of numeric entries | =COUNT(D2:D7) |
COUNT counts numbers. COUNTA counts non blank cells. Use COUNTIF and SUMIF when the question includes where or for such as revenue where region is West.
4) Math and Trigonometric Functions
Everyday math for clean reports:
=ROUND(A2,2)
=ABS(A2)
=POWER(A2,2)
=SQRT(A2)
ROUND to two decimals suits NPR totals. ABS clears a negative that should be positive. POWER and SQRT handle squares and roots.
Trig for syllabus familiarity - Excel expects radians:
=SIN(RADIANS(30)) → 0.5
=COS(RADIANS(60)) → 0.5
Business use is limited. Know the RADIANS wrapper for lab quizzes, then focus on IF, lookup, and aggregates for real work.
5) Financial Functions
Monthly EMI for a loan of NPR 500,000 at 10 percent annual for 60 months:
=PMT(10%/12, 60, -500000)
- Rate per period equals annual rate divided by 12
- nper equals number of months
- Negative pv makes the result display as a positive payment
- Also useful from the same family: FV, PV, RATE with the same argument pattern
Syllabus note: the sign depends on cash flow direction. A positive pv with default sign gives a negative payment. Using -500000 for pv keeps the EMI positive for display.
6) Date and Time Functions
=TODAY()
=NOW()
=DATE(2026,8,26)
=DATEDIF(B2,TODAY(),"Y") // years of service
TODAY is the date, NOW is date plus time, DATE builds a fixed date from year month day. DATEDIF with Y returns whole years between two dates. The function exists in Excel even when autocomplete does not list it. Check tenure and age this way for employee and student records.
Errors and Fixes
| Problem | Cause | Fix |
|---|---|---|
| #N/A from VLOOKUP | Lookup value not found, or extra spaces | Check spelling, use TRIM on the key, confirm the first column holds the key |
| VLOOKUP returns wrong row | Last argument omitted or set to TRUE | Use FALSE for exact match |
| #NAME? error | Function name misspelled or text without quotes | Check spelling, put text such as Pass in double quotes |
| PMT gives a negative or huge value | Annual rate not divided by 12, or sign of pv | Use rate divided by 12, months for nper, and negative pv |
| Boundary grade wrong at 50 or 10000 | > used where >= was needed | Test values exactly at each boundary |
| DATEDIF not found in list | Not in autocomplete | Type the full name, it still works |
Nepal Worked Example: Student Result Sheet plus EMI - BS 2081
A student builds a result sheet on 2081-09-25 BS for five students. NPR examples and a loan EMI follow in the same file.
Result sheet in A1:F6:
| Name | Theory | Practical | Total | Result | Division |
|---|---|---|---|---|---|
| Sita | 72 | 80 | 152 | Pass | First |
| Ram | 45 | 60 | 105 | Fail | Second |
| Hari | 88 | 91 | 179 | Pass | Distinction |
| Gita | 50 | 49 | 99 | Fail | Second |
| Bikash | 63 | 55 | 118 | Pass | Second |
Formulas: D2 is =B2+C2, E2 is =IF(AND(B2>=50,C2>=50),”Pass”,”Fail”), F2 is =IF(D2>=160,”Distinction”,IF(D2>=120,”First”,”Second”)). Fill to row 6. Summary cells: =COUNTIF(E2:E6,”Pass”) gives 3, =AVERAGE(B2:B6) gives 63.6, =MAX(D2:D6) gives 179. Lookup: type Hari in H2, in I2 write =VLOOKUP(H2,A2:F6,4,FALSE) which returns 179, and cross check with =INDEX(D2:D6,MATCH(H2,A2:A6,0)) which also returns 179.
EMI block with NPR:
For a loan of NPR 500,000 at 10 percent annual for 60 months, =PMT(10%/12,60,-500000) returns about NPR 10,623.52 per month. For a second check, NPR 800,000 at 12 percent for 5 years is =PMT(12%/12,60,-800000) which returns about NPR 17,797.40 per month. Both divide the annual rate by 12 and use months for nper.
Date block: Join date in B2 as 2080-04-15 BS, tenure in years as =DATEDIF(B2,TODAY(),”Y”).
Self-check
VLOOKUP on an employee ID returns #N/A although the ID is visible in column A. The lookup uses =VLOOKUP(B15,A2:D7,4) without the last argument. A PMT in the same sheet shows a negative payment much larger than expected. What two fixes apply?
Summary
Logical functions decide, lookup functions find, statistical functions summarise, math functions clean numbers, financial functions price loans, date functions count time. Each group answers a distinct business prompt. Check boundaries, lock the lookup to exact, and divide the annual rate by 12.
Key Takeaways
- Combine IF with AND or OR for rules with several conditions. Test at the boundary value.
- Use exact match lookups with FALSE or 0 for names and IDs. Cross check VLOOKUP against INDEX plus MATCH.
- COUNTIF, SUMIF, and AVERAGEIF summarise by condition. Keep the criteria range and sum range aligned.
- For money, PMT needs rate per period, nper in months, and care with sign. ROUND EMI to two decimals for NPR.
- For tenure, DATEDIF with Y gives whole years even when autocomplete hides it.
- Verify every formula with one or two hand calculated answers before submission.
Discussion
Why does exact match matter more for an ID than for a tax band? When does a nested IF deserve a helper column? What happens to PMT if you enter the annual rate without dividing by 12?
Exercises
- Logical (calculable): Build ten students with Theory and Practical. Calculate Total, Pass if both at least 40, Division with three bands, and report counts.
- Lookup: Use VLOOKUP exact and INDEX plus MATCH on the same key set and report both returned values for one name.
- Aggregates: From the same sheet, calculate AVERAGE, MAX, MIN, COUNTIF Pass, and SUMIF for total where Pass, and state each number.
- Financial and date: Calculate EMI for NPR 800,000 at 12 percent for 5 years and tenure with DATEDIF from 2080-04-10 BS to today. Report EMI and years.
📚 Continue to: Data Management Basics


