PRC 110: Software Skills Practicum
📖 Read the full notes: MS Excel: Data Management Basics · MS Excel: Linking Workbooks and Worksheets
=IF(Condition, Value_if_True, Value_if_False)
=IF(B2>=45,"Pass","Fail")
Nested: =IF(D2>25000,"High",IF(D2>10000,"Medium","Low"))
= equal · <> not equal · > < · >= <=. Each test returns TRUE or FALSE.
Quick poll: A2 = 45 and B2 = Pokhara. Predict:
=A2>45 → FALSE (45 is not greater than 45)=IF(A2<>50,"Retest","OK") → Retest=IF(B2="pokhara","West","Other") → West: = ignores upper/lower case=IF(A2>=50,"Pass") → FALSE: with no third argument, IF shows FALSERule: text goes inside "double quotes"; numbers and cell references do not.
Ask a student or group first — then click to check.
Open sales_data_large.csv and Save As Excel Workbook (.xlsx) first. G = Sales Amount, rows 2–241.
Target Met?, H2 =IF(G2>5000,"Yes","No"), double-click the fill handle. → H2 Yes (12,632)=COUNTIF(H2:H241,"Yes") → 196 of 240Band, I2 =IF(G2>25000,"High",IF(G2>10000,"Medium","Low")), fill down. → I2 Medium; I8 Low (1,299)=COUNTIF(I2:I241,"High") → 108Discuss: 196 of 240 sales beat a 5,000 target. Is the target useful? What would you set?
=IF(AND(B2="West",G2>50000),"Star",""): both must be true. 23 rows get "Star".=IF(OR(B2="West",G2>100000),"Check",""): either one is enough. 103 rows.=IFS(G2>25000,"High",G2>10000,"Medium",TRUE,"Low") gives the same bands as the nested IF and is easier to read (Excel 2019, 2021, 2024 and Microsoft 365).Order matters: test the highest threshold first. If G2>10000 came first, a 2,08,852 sale would be labelled "Medium".
| Question | Formula | Result |
|---|---|---|
| How many Laptop sales? | =COUNTIF(C2:C241,"Laptop") | 32 |
| Sales above 1,00,000? | =COUNTIF(G2:G241,">100000") | 54 |
| West region revenue | =SUMIF(B2:B241,"West",G2:G241) | 92,25,197 |
| West Laptop revenue | =SUMIFS(G2:G241,B2:B241,"West",C2:C241,"Laptop") | 67,23,705 |
Trap: SUMIF puts the sum range last; SUMIFS puts it first.
Your turn: total revenue for salesperson Bikash. → =SUMIF(D2:D241,"Bikash",G2:G241) = 52,17,893
=VLOOKUP(Lookup_Value, Table_Array, Col_Index, FALSE)
Lookup. A1 Product, B1 Category.Category, J2 =VLOOKUP(C2,Lookup!$A$2:$B$9,2,FALSE), fill down. → J2 Accessory (USB Hub); J3 Computer (Monitor)Webcam to Web Cam. → every Webcam row shows #N/A. Press Ctrl+Z to undo.Why $A$2:$B$9? So the table stays put when you fill the formula down (Unit 3.2).
=TRIM(C2) strips extra spaces=IFERROR(VLOOKUP(…),"Not found")Discuss: should you always wrap lookups in IFERROR? → No. It also hides real mistakes, so show a clear message and check the "Not found" rows.
| VLOOKUP | INDEX + MATCH | XLOOKUP | |
|---|---|---|---|
| Available in | All versions | All versions | Excel 2021, 2024, Microsoft 365 |
| Return a column to the left? | No | Yes | Yes |
| Inserting a column inside the table | Can return the wrong column | Safe | Safe |
=INDEX(Lookup!$B$2:$B$9,MATCH(C2,Lookup!$A$2:$A$9,0))=XLOOKUP(C2,Lookup!$A$2:$A$9,Lookup!$B$2:$B$9,"Not found"): exact match by defaultPoll: which one would you use in a lab that still runs Excel 2016? → VLOOKUP or INDEX + MATCH
Data > Sort — single or multi-level.
Data > Filter — show only matching rows.
Never sort one column alone: the rows get scrambled. Sort the whole table.
Ask a student or group first — then click to check.
.xls format, which holds only 65,536 rows. Extra rows were cut off silently..xlsx sheet holds 1,048,576 rows. Contact tracing for the missing cases started days late.Pair discussion: which simple checks would have caught it? → compare row counts before and after (=COUNTA()) · check that totals look reasonable · use the right file format, or a database for big data
Use sales_data_large.csv:
Questions? Keep your workbook with the Lookup sheet; Unit 3.4 builds on it.
PRC 110: Software Skills Practicum · Unit 3.3