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

Hand Out LOOKUP FUNCTIONS

The document provides an overview of lookup functions in MS Excel, specifically VLOOKUP, HLOOKUP, and XLOOKUP. It details their purposes, syntax, limitations, examples, and common use cases for data management and analysis. XLOOKUP is highlighted as a more powerful alternative to VLOOKUP and HLOOKUP, offering greater flexibility and efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

Hand Out LOOKUP FUNCTIONS

The document provides an overview of lookup functions in MS Excel, specifically VLOOKUP, HLOOKUP, and XLOOKUP. It details their purposes, syntax, limitations, examples, and common use cases for data management and analysis. XLOOKUP is highlighted as a more powerful alternative to VLOOKUP and HLOOKUP, offering greater flexibility and efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

LOOKUP FUNCTIONS IN MS EXCEL

VLOOKUP

Purpose: Searches for a value in the first column of a table and returns a
value in the same row from a specified column.

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


lookup_value`
` : The value to search for.
t̀able_array`
: The range containing the data.
c̀ol_index_num` : The column number in the table from which to retrieve
the value.
[range_lookup]`
` : Optional. TRUE for approximate match or FALSE for an
exact match.

Example: V̀LOOKUP("Apple", A2:B10, 2, FALSE)`

Limitations:
● Can only search in the first column of the table.
● Not suitable for dynamic column reference.
● Inefficient with large datasets.
● for effective use.

HLOOKUP Function
The HLOOKUP function is designed to search for a value in the top row of a
table or range and returns a value in the same column from a specified row.

What is HLOOKUP?
HLOOKUP stands for Horizontal Lookup.
● Searches for a value in the top row of a table or range.
● Returns a value in the same column from a row you specify.
● Useful for finding items in a table or a range by row.
Syntax

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

lookup_value: The value to search for in the first row of the table_array.
table_array: The range of cells that contains the data. You can use a reference
to a range or a range name.
row_index_num: The row number in the table_array from which to retrieve
the value. Row 1 is the first row in table_array.
[range_lookup]: Optional. A logical value that specifies whether you want
HLOOKUP to find an exact match or an approximate match:
TRUE (or omitted) - returns an approximate match. Assumes the first row in
the table_array is sorted in ascending order.
FALSE - returns an exact match or #N/A if no match is found.

Examples

Exact Match

=HLOOKUP("Apple", A1:D2, 2, FALSE)


Searches for "Apple" in the first row of A1:D2 and returns the value from the
second row in the same column. It looks for an exact match of "Apple".

Approximate Match

=HLOOKUP(100, A1:D2, 2)

Assuming the first row of A1:D1 contains sorted numbers, this finds the largest
value less than or equal to 100 in the first row and returns the value from the
second row in the corresponding column. It allows for an approximate match
because the fourth argument is omitted (or TRUE).

Tips
● If HLOOKUP cannot find the lookup value, and [range_lookup] is TRUE,
it returns the largest value that is less than or equal to the lookup value.
● Use HLOOKUP when your comparison values are located in a row
across the top of a table of data, and you want to look down a specified
number of rows.

2
● For vertical lookup, where comparison values are in a column to the left
of the data you want to find, use VLOOKUP instead.

XLOOKUP Function
XLOOKUP is a powerful function in Excel that replaces older functions like
VLOOKUP and HLOOKUP. It allows you to search a range or array, find the
right value, and return a corresponding value from a different range or array.

Syntax of XLOOKUP
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found],
[match_mode], [search_mode])

★ lookup_value: The value you are searching for.


★ lookup_array: The array or range containing the value to look for.
★ return_array: The array or range containing the value to return.
★ if_not_found (optional): The value to return if the `lookup_value`is not
found.
★ match_mode (optional): Specifies the match type: exact match (0),
exact match or next smaller item (-1), wildcard match (2).
★ search_mode (optional): Specifies the search mode: first-to-last (1),
last-to-first (-1), binary ascending (2), binary descending (-2).

Example Uses

1. Basic XLOOKUP:
● Find the name of a student based on their ID.

XLOOKUP(1001, Student_IDs, Student_Names)


This formula looks for student ID 1001 in the Student_IDs range and returns
the corresponding name from the Student_Names range.

3
2. XLOOKUP with Not Found Message:
● Lookup with a custom message if the value is not found.

XLOOKUP("MAT301", Course_Codes, Course_Names, "Course Not Found")

Searches for "MAT301" in Course_Codes and returns the corresponding


name from Course_Names or "Course Not Found" if the code doesn't exist.

3. XLOOKUP with Match Mode:


● Use wildcard characters in lookup.

XLOOKUP("Bio*", Course_Names, Instructor_Names, ,2)

Finds the first course name starting with "Bio" and returns the
corresponding instructor's name.

4. Two-way Lookup:
● Find a specific grade for a student in a course.

XLOOKUP("ENG304", Course_Codes, XLOOKUP(Student_ID, Student_IDs,


Grades))

Nested XLOOKUP: first, it finds the row with the student's grade, then finds
the grade for "ENG304".

Common Use Cases


● Replacing VLOOKUP/HLOOKUP: Use XLOOKUP for more flexibility and
ease, especially when dealing with leftward lookups.
● Two-way Lookups: Ideal for tables where you need to look both
vertically and horizontally.
● Dynamic Ranges: Works well with dynamic arrays, providing more
versatility in data analysis.

4
Tips
● XLOOKUP is only available in Excel for Office 365 and Excel 2019.
● It's more robust and less prone to errors compared to
VLOOKUP/HLOOKUP.
● You can use XLOOKUP for both vertical and horizontal lookups.

Common Errors

● #N/A: Indicates that the function did not find the lookup_value.
● #REF!: Occurs if row_index_num is greater than the number of rows in
table_array.
● #VALUE!: If row_index_num is less than 1.

use cases of Lookup Functions

VLOOKUP
1. Employee Data Management: Use VLOOKUP to retrieve employee information
such as salary, department, or contact details based on their employee ID or name
from a separate employee database table.
2. Sales Analysis: Calculate sales commissions by looking up commission rates from a
table based on sales amounts.
3. Inventory Management: Retrieve product details such as price, quantity, or
description from an inventory table using product codes.
4. Gradebook Calculation: Assign letter grades to student scores by looking up grade
boundaries from a grading scale table based on their numeric score.
5. Customer Relationship Management (CRM): Retrieve customer information like
contact details, purchase history, or account status from a CRM database table
based on customer IDs.

5
HLOOKUP
1. Budget Planning: Retrieve budget figures for various expense categories (e.g.,
marketing, operations, salaries) from a budget table based on month names or
quarter names.
2. Project Management: Retrieve project status updates (e.g., completion
percentage, milestones achieved) from a project tracking table based on project IDs
or names.
3. Forecasting: Extract historical sales data for different products or regions from a
sales data table based on time periods (e.g., months, quarters).
4. Survey Analysis: Retrieve survey responses (e.g., ratings, comments) for specific
questions from a survey results table based on question IDs or topics.
5. Employee Shift Scheduling: Retrieve employee work schedules (e.g., shift times,
days off) from a scheduling table based on employee IDs or names.

XLOOKUP
1. Advanced Data Lookup: Use XLOOKUP to perform exact or approximate matches
with greater flexibility than VLOOKUP or HLOOKUP, including wildcard matches.
2. Data Reconciliation: Compare two datasets and retrieve corresponding values
from one dataset based on matches found in the other dataset.
3. Data Validation: Validate input data against a reference dataset and return error
messages or warnings for unmatched or invalid entries.
4. Dynamic Data Analysis: Create dynamic dashboards or reports that update
automatically based on user-selected criteria or filters using XLOOKUP to retrieve
relevant data.
5. Large Dataset Lookup: Handle large datasets more efficiently with XLOOKUP's
ability to perform searches faster than traditional lookup functions, especially in
scenarios involving millions of records.

You might also like