LookUp Function in Excel
LookUp Function in Excel
# Functions
1 LOOKUP Function
2 CHOOSE Function
3 MATCH Function
4 CHOOSE with MATCH Function
5 VLOOKUP Function
6 VLOOKUP with MATCH Function
7 VLOOKUP with CHOOSE Function
8 VLOOKUP with WILDCARD Function
9 VLOOKUP with SUMPRODUCT Function
10 XLOOKUP Function
11 HLOOKUP Function
12 HLOOKUP with MATCH Function
13 HLOOKUP with VLOOKUP Function
14 OFFSET with MATCH Function
15 OFFSET, VLOOKUP, with MATCH Function
16 MAX or MIN Function
17 MAX with IF Function
18 MAXIFS Function
19 IF with Product Function
20 INDEX with MATCH Function
1 Visit us at pavanlalwani.com
LOOKUP FUNCTION
[Find Specific Information in a Table or Range]
SYNTAX: =LOOKUP (lookup_value,array)
=LOOKUP (lookup_value, lookup_vector,[result_vector])
Problem Statement:
You are managing a small institute and have a list of employees with their respective Employee IDs, salaries,
designation, and DOJ. And your manager asks about the salary of a specific employee, this is when you can use the
LOOKUP function in Excel to quickly find the information.
Solution:
SYNTAX USED =LOOKUP (lookup_value,array)
Result:
LOOKUP(B38,B20:B23,C20:C23) LOOKUP(F40,F19:F22,H19:H22)
2 Visit us at pavanlalwani.com
CHOOSE Function
[Select a value from a list of values based on an index number]
Syntax = CHOOSE (index_num, value1, [value2], [value3], …)
Problem Statement:
You advise students on which course to take based on their interests. You want to display the course name based on a
student's choice.
• If a student wants to know about the course for option 3, what is the course name and its
fees?
• Gives function Number to basic function like Sum, Average, and Max and calculates it?
Solution:
Example =CHOOSE (N4, "Excel", "Power Query", "Power BI", "Tableau", "SQL Server")
Result:
3 Visit us at pavanlalwani.com
MATCH Function
[Find the position (row or column number) of a specific item in a range]
Problem Statement:
You are helping students to find the position of a specific course in a list of available courses. By
using the MATCH function, you can easily determine the course's position in the list.
• If you want to find out the position of the course 'Tableau' in the course list, what is its
position?
• If you want to find out the column number of the Fees column, how would you do it?
Solution:
Tableau 4 2
MATCH(AK28,AM20:AM24,0) MATCH(AK33,AK19:AM19,0)
4 Visit us at pavanlalwani.com
CHOOSE with MATCH Function
[Dynamically select values based on criteria]
Problem Statement:
You are an academic advisor helping students choose courses based on their interests. You want to
display the course Discount% dynamically based on the course they select from a list.
• A student wants to know the discount% for the course 'Tableau.' How can we find that using
the CHOOSE and MATCH functions?
Solution:
Course Discount %
Tableau 20
CHOOSE(MATCH(AR27,AS19:AS23,0),AT19,AT20,AT21,AT22,AT23)
5 Visit us at pavanlalwani.com
VLOOKUP (Vertical Lookup) function
[Search for a value in the first column of a range (or table) and return a value in the same
row from a specified column]
Problem Statement:
You are the ADMIN at an institute, and you need to provide information about new employees to your team. You
want to identify which employee joined most recently and gather details about their designation and joining date.
Employee Table
Emp ID Emp Name Designation DOJ
202 Abhay Manager 10/Jan/24
203 Rohan Sr. Manager 23/Oct/24
201 Harsh Executive 8/Aug/24
Solution:
201 Executive
VLOOKUP(AE13,AE5:AH8,2,0) VLOOKUP(AE17,$AE$5:$AH$8,3,0)
In this function, we need to use absolute cell references for the table array. This way, we can keep the table
array fixed, so it doesn't change or move when we copy the formula to other cells or drag downside.
6 Visit us at pavanlalwani.com
VLOOKUP with MATCH Function
Problem Statement:
You are a teacher at a training institute, and you have the following dataset of students and their courses
Employee Table
Emp ID Emp Name Designation DOJ
• Use the VLOOKUP function to find out the designation for the given Emp ID
• Find out the position of Emp ID in Emp ID column
• Use a combination of VLOOKUP & MATCH to find out the Emp Name of Emp ID 201
Solution:
7 Visit us at pavanlalwani.com
VLOOKUP with CHOOSE function
Problem Statement:
Imagine you are managing employee records on an Excel sheet.
You have the following data on employee names, their unique IDs, and their job designations:
Employee Table
Emp Name Emp ID Designation DOJ
Abhay 202 Manager 10/Jan/24
Rohan 203 Developer 23/Oct/24
Harsh 201 Designer 8/Aug/24
Your boss asks you to quickly retrieve details for employees based on their IDs. However, you realize that Emp ID is in
the second column, making it difficult to use a simple VLOOKUP (which requires the lookup column to be first).
Solution:
8 Visit us at pavanlalwani.com
VLOOKUP with WILDCARD Function
Problem Statement:
Course Details
Course ID Course Name Discount %
PLTL4 Tableau 20
PLTL19 Adv SQL Server 10
PLTL2 Power Query 15
PLTL3 Power BI 5
PLTL6 Adv Excel 12
PLTL18 Adv Power BI 13
PLTL1 Excel 10
PLTL17 Adv Power Query 11
PLTL5 SQL Server 25
• You want to look up the discount% of any course starting with 'Adv' and require the first
match.
• Your manager asks you to quickly find the discount% of any course that contains 'BI' and
require the first match.
• Your manager asks you to quickly find the course of any course ID that contains 'PLTL1' and
require the first match.
Solution:
* (Asterisk): Matches any number of characters (e.g., *abc can match '1abc', 'xyzabc', 'abc').
Discount % Discount %
10 5
VLOOKUP("Adv*",CG18:CH27,2,0) VLOOKUP("*BI",CG22:CH30,2,0)
9 Visit us at pavanlalwani.com
? (Question mark): Matches exactly one character (e.g., abc? can match 'abcd', 'abce').
Course
Adv SQL Server
VLOOKUP("PLTL1?",CF24:CG33,2,0)
10 Visit us at pavanlalwani.com
VLOOKUP with SUMPRODUCT Function
[Calculate values based on lookup results from multiple tables.]
Problem Statement:
• You have two tables of data: one with course fees and another with course discount
percentages.
• Your manager wants to see the total discount amount.
Solution:
11 Visit us at pavanlalwani.com
XLOOKUP Function
SYNTAX XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found],
[match_mode], [search_mode])
XLOOKUP is a powerful and flexible lookup function in Excel that’s designed to overcome many
limitations of VLOOKUP and HLOOKUP.
Introduced in Excel 365 and Excel 2019, XLOOKUP can search for a value in a range and return a
corresponding result from another range.
Unlike VLOOKUP, XLOOKUP does not require the lookup column to be on the left, and it can search
from the bottom up, perform exact or approximate matches, and even return multiple values.
12 Visit us at pavanlalwani.com
6 [search_mode] Optional Specifies the direction
for searching. Options
are:
1 (default): Search
from the first to the
last item.
-1: Search from the
last to the first item.
2: Perform a binary
search in ascending
order.
-2: Perform a binary
search in descending
order.
Problem Statement:
Emp ID Name Salary
101 Aditi 50000
102 Ravi 55000
103 Mohit 48000
105 Sunita 60000
110 Pooja 52000
Solution:
• Exact Match only ( match_mode=0)
XLOOKUP(CB50,CB40:CB44,CD40:CD44,"Not Found",0)
Emp ID Salary
104 48000
XLOOKUP(CB58,CB40:CB44,CD40:CD44,"Not Found",-1)
If you want the exact salary of "Emp ID 104". However, if "104" isn't found, you are okay with the salary of the next
alphabetically smaller emp id
Emp ID Salary
104 60000
13 Visit us at pavanlalwani.com
XLOOKUP(CB66,CB40:CB44,CD40:CD44,"Not Found",1)
You want to exact salary of "Emp ID 104", but if it's unavailable, you will accept the salary of the next alphabetically
larger emp id
ra 55000
XLOOKUP("ra*",CC40:CC44,CD40:CD44,"Not Found",2)
Course Details
Adv Power
PLTL18 13 PLTL20 Excel 8 PLTL20 Excel 8
BI
14 Visit us at pavanlalwani.com
[search_mode]
1 (Default): Search from first to Last
This is the default setting. Excel searches the lookup_array starting from the first element and moving
to the last useful for most situations where you want to find the first occurrence of the lookup_value
Emp ID Name
Excel 10
XLOOKUP(CB89,CC105:CC115,CD105:CD115,"Not Fount",0,1)
Excel searches the lookup_array starting from the last element and moving to the first useful when
you want to find the last occurrence of the lookup_value in the list, if the lookup_array contains
multiple instances of the value, this mode will return the price of the last Course name found
Emp ID Name
Excel 5
XLOOKUP(CB100,CC105:CC115,CD105:CD115,"Not Fount",0,-1)
15 Visit us at pavanlalwani.com
HLOOKUP Function
[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 in that table or range. It is particularly useful for horizontal data
lookups, where the data is organized in rows rather than columns.]
Problem Statement:
You are an admin at an institute, and your manager wants to quickly find the sales of specific
quarters based on course names.
Courses Sold
Courses Q1_Sales Q2_Sales Q3_Sales Q4_Sales
Excel 58 93 96 57
Power Query 20 46 44 34
Power BI 34 59 52 35
Tableau 31 96 42 94
SQL Server 39 78 52 97
Solution:
Q3_Sales 52
Power BI 180
HLOOKUP(CP32,CP12:CT17,4,0) HLOOKUP(CP37,CP32:CU33,2,0)
16 Visit us at pavanlalwani.com
HLOOKUP with MATCH Function
[The HLOOKUP function combined with the MATCH function allows for dynamic row
selection in horizontal lookups. MATCH helps to find the row number, making HLOOKUP
flexible for changing data sets.]
MATCH FUNCTION:
[Find out row and column number]
Problem Statement:
If we have course sold and course fees data:
Courses Sold
Courses January February March April
Excel 58 93 96 57
Power Query 20 46 44 34
Power BI 34 59 52 35
Tableau 31 96 42 94
SQL Server 39 78 52 97
Solution:
17 Visit us at pavanlalwani.com
HLOOKUP with VLOOKUP Function
[Combining HLOOKUP and VLOOKUP functions allows you to dynamically retrieve data
from two datasets. This is useful for calculations that rely on different lookup directions
(horizontal and vertical)].
Problem Statement:
Using both functions, you need to calculate the total revenue from two datasets.
Courses Sold
Courses Q1_Sales Q2_Sales Q3_Sales Q4_Sales
Excel 58 93 96 57
Power Query 20 46 44 34
Power BI 34 59 52 35
Tableau 31 96 42 94
SQL Server 39 78 52 97
Course Fees
ID Course Name Fees
1 Excel 2000
2 Power Query 3000
3 Power BI 5000
4 Tableau 4500
5 SQL Server 3500
Solution:
Calcualte the total amount
Courses Q1_Sales Q2_Sales Q3_Sales Q4_Sales
Excel 116000 186000 192000 114000
Power Query 60000 138000 132000 102000
Power BI 170000 295000 260000 175000
Tableau 139500 432000 189000 423000
SQL Server 136500 273000 182000 339500
HLOOKUP(DL$24,$DK$12:$DO$17,MATCH($DK25,$DK$12:$DK$17,0),0)*VLOOKUP($DK25,$DR$12:$DS$17,2,0)
18 Visit us at pavanlalwani.com
OFFSET with MATCH function
SYNTAX OFFSET(reference, rows, cols, [height], [width])
MATCH(lookup_value,lookup_array,[match_type])
Problem Statement:
• You are maintaining Institutes expenses data, You manager want to know office rent of Apr month
• You manager want to see Laptop Rent of Qtr 2
Monthly Expenses
Expenses Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Office Rent 3838 4125 5591 7954 4817 4125 4397 5120 5799 6800 5872 6945
Electricity 1432 1361 1107 1126 1078 1151 1453 1152 1355 1025 1138 1170
Internet 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500 1500
Laptop
4535 4988 4212 4342 4508 4909 4046 4146 4095 4326 4648 4027
Rent
Materials 244 189 407 157 452 375 295 240 166 118 197 205
Certificatio
100 100 100 100 100 100 100 100 100 100 100 100
n
Salary 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000
Stationery 381 455 131 485 473 354 239 147 295 187 288 436
Solution:
Expenses Apr
Office Rent 7954
OFFSET(DS31,MATCH("Rent",DS32:DS36,0),MATCH("Q2_Sales",DT31:DW31,0))
Salary
50000
Stationery 436
OFFSET(DT17,MATCH(DT41,DT18:DT25,0),MATCH(DU40,DU17:EF17,0),4,1)
19 Visit us at pavanlalwani.com
OFFSET with AVERAGE, SUM, MATCH function
SYNTAX OFFSET(reference, rows, cols, [height], [width])
AVERAGE(number1,[number2],..)
SUM(number1,[number2],..)
MATCH(lookup_value,lookup_array,[match_type])
Problem Statement:
• You have maintaining student admission data
• Your manager wants to know the average student enrollment for the Power BI course in Q2.
• Your manager wants to know the total student enrollment for the Excel course in Q3
Admission Data
Month Excel Power Query Power BI Tableau SQL Server
Jan 15 19 13 14 11
Feb 7 13 8 13 3
Mar 16 9 10 3 6
Apr 8 3 5 11 11
May 17 9 8 10 4
Jun 3 15 9 6 9
Jul 17 6 20 10 18
Aug 6 7 20 5 4
Sep 10 19 3 14 18
Oct 16 8 16 7 18
Nov 19 12 13 3 3
Dec 7 20 12 4 16
Solution:
Course Q2
Power BI 14.33333333
AVERAGE(OFFSET(EH17,7,MATCH(EH35,EI17:EM17,0),3,1))
Q3 Total Admission
Oct 174
SUM(OFFSET(EH17,MATCH(EH52,EH18:EH29,0),1,3,5))
20 Visit us at pavanlalwani.com
VLOOKUP, OFFSET with MATCH function
Problem Statement:
• You are working as an accountant in a coaching institute.
• Your CA wants to quickly know the Jan months Excel & Power BI course total GST Amt.
• Your CA wants to quickly know the Mar months Power Query & SQL Server course total GST Amt.
GST Data
Month Excel Power Query Power BI Tableau SQL Server
Jan 4401 6100 1965 1962 3080
Feb 5757 1698 9156 2016 2055
Mar 4437 1403 6150 1611 5166
Solution:
• Find out total GST amount of course Excel & Power BI for Jan Months.
Ans: 6366
Function: VLOOKUP ("Jan", ER15:EW18, MATCH ("Excel", ER15:EW15,0),0) +OFFSET (ER15, MATCH ("Jan", ER16:ER18,0),
MATCH ("Power BI", ES15:EW15,0),1,1)
• Find out total GST amount of course Power Query & SQL Server for Mar Months.
Ans: 6569
Function: VLOOKUP ("Mar", ER15:EW18, MATCH ("Power Query", ER15:EW15,0),0) +OFFSET (ER15, MATCH ("Mar",
ER16:ER18,0), MATCH ("SQL Server", ES15:EW15,0),1,1)
21 Visit us at pavanlalwani.com
MAX or MIN function
SYNTAX MAX (number1, [number2]..)
Problem Statement:
• You have year 2023 student's total enrollment data
• You manager want to know quickly highest enrollment
• You manager want to know quickly lowest enrollment
Solution:
Highest Student Enrollment
871
MAX(ET13:ET24)
22 Visit us at pavanlalwani.com
MAX with IF function
SYNTAX MAX(number1,[number2]..)
IF(logical_test,[value_if_true],[value_if_false])
Problem Statement:
• You have year 2023 students total enrollment data
• You manager want to know quickly highest enrollment for Excel course
• You manager want to know quickly lowest enrollment for Power BI Course
Solution:
Course Enrollment
Excel 871
MAX(IF(FA12:FA23=EZ28,FB12:FB23,""))
Course Enrollment
Power BI 318
MIN(IF(FA13:FA24=EZ36,FB13:FB24,""))
23 Visit us at pavanlalwani.com
MAXIFS function
[Find the maximum value based on one or more conditions. This is useful for datasets
where you want to find the maximum in a filtered data]
Problem Statement:
Suppose you want to find the maximum student enrollment for a specific course like Excel. Your manager want to
know the lowest enrollment for Power Query course
Solution:
Course Enrollment
Excel 871
MAXIFS(FH15:FH26,FG15:FG26,FF30)
Course Enrollment
Power Query 112
MINIFS(FH13:FH24,FG13:FG24,FF34)
24 Visit us at pavanlalwani.com
IF with PRODUCT function
SYNTAX IF(logical_test,[value_if_true],[value_if_false])
PRODUCT(number1,[number2]..)
Problem Statement:
You're working on a Year 2023 student enrollment data and you need to calculate a "weighted revenue" based on
course, enrollment, fees, and discount rates. You want to find the revenue for only those items with a specific month
and apply a discount to get a result.
• Calculate the total revenue for course after applying the discount rate, using a formula that combines
PRODUCT with other functions
Solution:
25 Visit us at pavanlalwani.com
INDEX with MATCH function
SYNTAX: INDEX(array,row_num,[column_num])
MATCH(lookup_value,lookup_array,[match_type])
Problem Statement:
Suppose you work in a company's HR department, and you have a dataset listing employees’ details.
You want to retrieve an employee’s designation and date of joining (DOJ) based on their Emp Name and Emp ID.
Employee Table
Emp ID Emp Name Designation DOJ
202 Abhay Manager 10/Jan/24
203 Rohan Developer 23/Oct/24
201 Harsh Designer 8/Aug/24
204 Abhay Analyst 15-Mar-24
• Retrieve the Designation and DOJ for "Abhay" with Emp ID 204.
• Retrieve the Emp ID for Employee Rohan.
Solution:
Name Emp ID
Rohan 203
INDEX(FX17:GA21,MATCH(FX38,FY17:FY21,0),MATCH(FY37,FX17:GA17,0))
26 Visit us at pavanlalwani.com
Visit Now On: