Hothouse Design | Excel Lookup Lab Activity
LAB ACTIVITY
Using VLOOKUP to Display Department Names
Cambridge IGCSE Information Technology 0418/03 Practical Task
Objective: Use the Dcode in J8PHONE.CSV as a lookup value and retrieve the matching Department name from J8CODE.CSV using relative and absolute cell references.
Task requirement provided in the practical paper
Files required
File
Purpose
J8PHONE.CSV
Main worksheet where Department names will be filled.
J8CODE.CSV
Lookup table containing DCode and Department.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 1: Open the J8PHONE file
Open Microsoft Excel.
Open the file J8PHONE.CSV.
Confirm that the Department / Dcode / Number / Total Duration table is visible in rows 6 to 13.
The main call data begins from row 15.
Figure 1: J8PHONE.CSV opened in Microsoft Excel
Check: The Department cells A7:A13 are blank and the Dcodes MD, AC, PR, SA, HR, PU and MA appear in B7:B13.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 2: Open the J8CODE lookup file
Keep J8PHONE.CSV open.
Open J8CODE.CSV in Excel.
Check that column A contains DCode and column B contains Department.
This table will be used as the VLOOKUP array.
Figure 2: J8CODE.CSV showing the DCode and Department lookup table
Examples: MD = Managing Director, AC = Accounts, PR = Production, SA = Sales, HR = Human Resources, PU = Purchasing, MA = Maintenance.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 3: Select cell A7 and choose VLOOKUP
Return to the J8PHONE worksheet.
Click cell A7 under the Department heading.
Click the Insert Function (fx) button.
Search for VLOOKUP, select VLOOKUP, and click OK.
Figure 3: Cell A7 selected and VLOOKUP chosen from Insert Function
Purpose: A7 is where the department name for the Dcode in B7 will be displayed.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 4: Set B7 as the Lookup_value
In the Function Arguments window, click inside Lookup_value.
Click cell B7, which contains MD.
Excel inserts B7 into Lookup_value.
B7 is a relative reference. When the formula is copied down, it will change to B8, B9, B10 and so on.
Figure 4: B7 selected as the VLOOKUP lookup value
Relative reference
Lookup_value = B7
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 5: Select the J8CODE table and make the range absolute
Click inside the Table_array box.
Without closing the Function Arguments window, switch to J8CODE.CSV.
Select cells A2:B13. Do not select only the Department column.
Press F4. Excel changes the range to $A$2:$B$13.
The dollar signs lock the lookup table so the range does not move when the formula is copied.
Figure 5: Select A2:B13 in J8CODE.CSV and press F4 to create an absolute reference
Important correction: The screenshot captured an intermediate selection. The correct Table_array is A2:B13 because VLOOKUP must search DCode in column A and return
Department from column B.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 6: Complete the remaining VLOOKUP arguments
In Col_index_num, enter 2 because Department is the second column of the selected lookup table.
In Range_lookup, enter FALSE to require an exact Dcode match.
Click OK.
Completed formula
=VLOOKUP(B7,'[J8code.csv]J8code'!$A$2:$B$13,2,FALSE)
Expected result in A7: Managing Director
Meaning of each part
Formula part
Type
Meaning
B7
Relative reference
Dcode to look up. Changes as the formula is copied down.
$A$2:$B$13
Absolute reference
Locked lookup table in J8CODE.CSV.
2
Column index
Returns the Department from the second column.
FALSE
Exact match
Only returns a result when the Dcode matches exactly.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV
Hothouse Design | Excel Lookup Lab Activity
Step 7: Replicate the formula for all seven departments
Click cell A7 again.
Point to the small fill handle at the bottom-right corner of A7.
Drag the fill handle down to A13.
Excel changes the relative lookup reference B7 to B8, B9, B10, B11, B12 and B13 while keeping $A$2:$B$13 fixed.
Expected completed result
Department
Dcode
Managing Director
MD
Accounts
AC
Production
PR
Sales
SA
Human Resources
HR
Purchasing
PU
Maintenance
MA
Task complete: The Department column now shows the department name for each of the seven Dcodes. The formula uses both a relative reference (B7) and an absolute
reference ($A$2:$B$13), as required.
VLOOKUP Practical Tutorial - J8PHONE.CSV and J8CODE.CSV