0% found this document useful (0 votes)
26 views6 pages

Lab No 7 Solved

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

Lab No 7 Solved

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LAB NO.

07

Task-1: Learning and Applying the VLOOKUP Formula


Objective:
Students will learn how to use the VLOOKUP function in Excel to search for data in a specific
column of a table and return the corresponding value from another column.

Step-by-Step Instructions:

Step 1: Understand the VLOOKUP Syntax


The general syntax for VLOOKUP is:

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

 lookup_value: The value you want to search for in the first column of the table.
 table_array: The range of the table where you will perform the search.
 col_index_num: The column number in the table from which to retrieve the data.
 range_lookup: A logical value that determines whether to perform an approximate or
exact match. Use TRUE for an approximate match or FALSE for an exact match.

Step 2: Set Up a Sample Table in Excel


Ask students to create the following table in their worksheet:
Step 3: Write the VLOOKUP Formula
Suppose you want to find the Department of the employee with ID 103.

1. Click on an empty cell (e.g., E2).


2. Enter the following formula:

=VLOOKUP(103, A2:D5, 3, FALSE)

3. Press Enter.

Step 4: Understand the Formula


 103: This is the lookup_value and corresponds to the employee ID you want to find.
 A2:D5: This is the table_array where Excel will search for the value.
 3: This is the col_index_num (the Department column is the 3rd column in the table).
 FALSE: This specifies that you want an exact match.

Step 5: Observe the Result


 The formula will return Finance, as the employee with ID 103 works in the Finance
department.
 Result: Emily Davis.

Additional Task for Students


1. Add a column called Performance to the existing table with the following data:

Performance
Excellent
Good
Average
Excellent

2. Write a VLOOKUP formula to find the Performance rating for employee ID 101.

Task-2: VLOOKUP uses column numbers


1. To find the Salary of employee ID 102:

=VLOOKUP(102, A2:D5, 4, FALSE)

Result: 60,000.
o
2. To find the Name of employee ID 104:

=VLOOKUP(104, A2:D5, 2, FALSE)

Task-3: Learning and Applying the HLOOKUP Formula


Objective:

Students will learn how to use the HLOOKUP function in Excel to search for data in the first
row of a table and return the corresponding value from another row.
Step-by-Step Instructions:

Step 1: Understand the HLOOKUP Syntax


The general syntax for HLOOKUP is:

HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

 lookup_value: The value you want to search for in the first row of the table.
 table_array: The range of the table where you will perform the search.
 row_index_num: The row number in the table from which to retrieve the data.
 range_lookup: A logical value that determines whether to perform an approximate or
exact match. Use TRUE for an approximate match or FALSE for an exact match.

Step 2: Set Up a Sample Table in Excel


Ask students to create the following table in their worksheet, starting from cell A1:
Step 3: Write the HLOOKUP Formula
Suppose you want to find the Name of the employee with ID 103.

1. Click on an empty cell (e.g., F2).


2. Enter the following formula:

=HLOOKUP(103, A1:E4, 2, FALSE)

3. Press Enter.

Step 4: Understand the Formula


 103: This is the lookup_value and corresponds to the employee ID you want to find.
 A1:E4: This is the table_array where Excel will search for the value.
 2: This is the row_index_num (the Name row is the 2nd row in the table).
 FALSE: This specifies that you want an exact match.

Step 5: Observe the Result


 The formula will return Mike Johnson, as the employee with ID 103 is in the Name row.

Step 6: Apply for Different Scenarios


1. To find the Department of employee ID 102:

=HLOOKUP(102, A1:E4, 3, FALSE)

o Result: IT.
2. To find the Salary of employee ID 104:

=HLOOKUP(104, A1:E4, 4, FALSE)

o Result: 58,000.
o
Task-4: HLOOKUP Function

SIKANDER HAYAT KHIYAL SAUD SAJJAD AHMAD

THE END!

You might also like