0% found this document useful (0 votes)
4 views28 pages

LookUp Function in Excel

The document provides an overview of various Excel functions including LOOKUP, CHOOSE, MATCH, VLOOKUP, and XLOOKUP, detailing their syntax and practical applications. It includes problem statements and solutions demonstrating how to use these functions to retrieve specific data from tables. Each function is explained with examples relevant to managing employee and course information in an educational context.

Uploaded by

Kawtar X
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)
4 views28 pages

LookUp Function in Excel

The document provides an overview of various Excel functions including LOOKUP, CHOOSE, MATCH, VLOOKUP, and XLOOKUP, detailing their syntax and practical applications. It includes problem statements and solutions demonstrating how to use these functions to retrieve specific data from tables. Each function is explained with examples relevant to managing employee and course information in an educational context.

Uploaded by

Kawtar X
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/ 28

INDEX

# 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.

Sales Table Employee Table

Emp ID Salary Emp ID Emp Name Designation DOJ

203 30000 202 Abhay Manager 10/Jan/24

201 40000 203 Rohan Developer 23/Oct/24

202 35000 201 Harsh Designer 8/Aug/24

• What is the salary of the employee with Employee ID 203?


• What is the designation of the employee with Employee ID 202?
• What is the DOJ of the employee with Employee ID 203?

Solution:
SYNTAX USED =LOOKUP (lookup_value,array)
Result:

Single dimensional Multiple Dimensional

Emp ID Salary Emp ID Designation Emp ID DOJ

203 30000 202 Manager 203 23/Oct/24

LOOKUP(B29,B20:C23) LOOKUP(F29,F20:H23) LOOKUP(I29,F20:I23)

SYNTAX USED =LOOKUP (lookup_value, lookup_vector,[result_vector])


Result:

Emp ID Salary Emp ID Designation

203 30000 203 Developer

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.

ID Fees Course Name


1 2000 Excel
2 3000 Power Query
3 5000 Power BI
4 4500 Tableau
5 3500 SQL Server

• 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:

CHOOSE Function with Sum, Average, and Max

Function No. Fees


1 18000
2 3600
3 5000

CHOOSE(N15, SUM($P$5:$P$9), AVERAGE($P$5:$P$9), MAX($P$5:$P$9))

3 Visit us at pavanlalwani.com
MATCH Function
[Find the position (row or column number) of a specific item in a range]

SYNTAX MATCH (lookup_value, lookup_array, [match_type])

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.

ID Fees Course Name


1 2000 Excel
2 3000 Power Query
3 5000 Power BI
4 4500 Tableau
5 3500 SQL Server

• 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:

Course Name Text Position Fees

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]

SYNTAX CHOOSE(index_num, value1, [value2], [value3], …)

MATCH(lookup_value, lookup_array, [match_type])

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.

ID Course Name Discount %


1 Excel 10
2 Power Query 15
3 Power BI 5
4 Tableau 20
5 SQL Server 25

• 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]

SYNTAX Vlookup(lookup_value, table_array, col_index_num,[range_lookup])

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

• What is the designation of employee id 201?


• What are the designations of given employee IDs?

Solution:

Emp ID Emp Name Emp ID Designation

201 Harsh 202 Manager

203 Sr. Manager

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

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

MATCH (lookup_value, lookup_array, [match_type])

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

202 Abhay Manager 10/Jan/24


203 Rohan Developer 23/Oct/24
201 Harsh Designer 8/Aug/24

• 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:

Emp ID Designation Emp ID Position

202 Manager 202 2


VLOOKUP(BP29,BP21:BR24,3,0) MATCH(BP34,BP21:BP24,0)

Emp ID Emp Name


201 Harsh
VLOOKUP(BP40,BP21:BS24,MATCH(BQ39,BP21:BS21,0),0)

7 Visit us at pavanlalwani.com
VLOOKUP with CHOOSE function

SYNTAX: Vlookup(lookup_value, table_array, col_index_num,[range_lookup])


CHOOSE(index_num, value1,[value2],[value3]….)

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:

Emp ID Emp Name


203 Rohan
VLOOKUP(BX26,CHOOSE({1,2},BY20:BY22,BX20:BX22),2,0)

8 Visit us at pavanlalwani.com
VLOOKUP with WILDCARD Function

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

There are two main wildcards in Excel:

• Asterisk (*): Represents any number of characters.


• Question mark (?): Represents a single character.

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.]

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

SUMPRODUCT(array1, [array2], [array3], …)

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.

Course ID Fees Course ID Course Name Discount %

PLTL1 2500 PLTL1 Excel 10

PLTL2 3000 PLTL2 Power Query 15

PLTL3 5000 PLTL3 Power BI 5

PLTL4 4000 PLTL4 Tableau 20

PLTL5 3500 PLTL5 SQL Server 25

Solution:

Total Discount Amount


262500
SUMPRODUCT(CP15:CP19,VLOOKUP(CO15:CO19,CR15:CT19,3,0))

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.

Parameter Requirement Description Example


1 lookup_value Required This is the value you Example: If you want to
are searching for find a specific student's
grade, the student's name
would be the lookup_value
2 lookup_array Required This is the range or Example: If you have a list
array where Excel will of student names in cells
search for the A2 to A10, this range is the
lookup_value. lookup_array
3 return_array Required This is the range or Example: If the grades are
array from which in cells B2 to B10, you’d
XLOOKUP will return set return_array as B2 to
the result if it finds a get the corresponding
match. grade for the matched
student name
4 [if_not_found] Optional Specifies what to Example: Manually enter
return if no match is 'Not Found' to return if no
found. match is found
5 [match_mode] Optional Determines how
XLOOKUP matches the
lookup_value. Options
are:
0 (default): Exact
match only.
-1: Exact match or
next smaller item.
1: Exact match or next
larger item.
2: Wildcard match
(e.g., using * or ? to
represent partial
matches)

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)

Emp ID Salary If we want to find out salary of Emp ID 104

If this Emp ID 104 is not available in Emp ID then


104 Not Found

XLOOKUP(CB50,CB40:CB44,CD40:CD44,"Not Found",0)

• Exact Match or Next Smaller Item (match_mode=-1)

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

• Exact Match or Next Larger Item (match_mode=1)

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

• Wildcard Match (match_mode=2)

You want to find the price of any name of employee that


Name Salary contains"ra" in its name using a wildcard search. This will
match names like: "Ravi"

ra 55000
XLOOKUP("ra*",CC40:CC44,CD40:CD44,"Not Found",2)

Match_mode Scenario Result


0 Exact match only Not Found
-1 Exact match or next smaller item 52000
1 Exact match or next larger item 55000
2 Wildcard match 55000

Course Details

Course Course Course Course Course Course


Discount % Discount % Discount %
ID Name ID Name ID Name

PLTL4 Tableau 20 PLTL6 Adv Excel 12 PLTL4 Tableau 20

Adv SQL Adv Power


PLTL19 10 PLTL18 13 PLTL5 SQL Server 25
Server BI
Power Adv Power Power
PLTL2 15 PLTL17 11 PLTL2 15
Query Query Query
Adv SQL
PLTL3 Power BI 25 PLTL19 10 PLTL3 Power BI 25
Server

PLTL6 Adv Excel 12 PLTL21 Excel 5 PLTL1 Excel 10

Adv Power
PLTL18 13 PLTL20 Excel 8 PLTL20 Excel 8
BI

PLTL1 Excel 10 PLTL1 Excel 10 PLTL21 Excel 5

Adv Power Adv SQL


PLTL17 11 PLTL3 Power BI 25 PLTL19 10
Query Server
Power Adv Power
PLTL5 SQL Server 25 PLTL2 15 PLTL17 11
Query Query
Adv Power
PLTL20 Excel 8 PLTL5 SQL Server 25 PLTL18 13
BI

PLTL21 Excel 5 PLTL4 Tableau 20 PLTL6 Adv Excel 12

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)

-1: Search from Last to First

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)

2 : Binary Search (Descending Order)


Performs a binary search on the lookup_array, assuming it is sorted in descending order.Similar to
option 2, but for datasets sorted in descending order.

Course Name Discount %


Excel 5
XLOOKUP(CB134,CK105:CK115,CL105:CL115,"No",0,-2)

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.]

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

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

Courses Excel Power Query Power BI Tableau SQL Server


Total Sales 304 144 180 263 266

• Find out Excel Course Qty

Solution:

Qtr. Power BI Course Total Sales

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.]

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


MATCH(lookup_value, lookup_array, [match_type])

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

• You want to first create course sold data in transpose


• You want to calculate the total revenue by using both datasets

Solution:

Courses Excel Power Query Power BI Tableau SQL Server


Q1_Sales 58 20 34 31 39
Q2_Sales 93 46 59 96 78
Q3_Sales 96 44 52 42 52
Q4_Sales 57 34 35 94 97
HLOOKUP($CZ20,$CQ$12:$CT$17,MATCH(DA$19,$CP$12:$CP$17,0))

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)].

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

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

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])

reference required explanation


rows required We can use here MATCH function
cols required We can use here MATCH function
The number of rows you want the final range to cover. If omitted the height will
height optional
match the reference
The number of columns you want the final range to cover. If omitted, the width will
width optional
match the reference

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))

Expenses Qtr 2 Expenses Dec

Laptop Rent 4046 4146 4095 Materials 205


OFFSET(DS16,MATCH(DS34,DS17:DS24,0),7,1,3)
Certification 100

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))

Month Total Admission


Jan 72
SUM(OFFSET(EH17,MATCH(EH41,EH18:EH29,0),1,1,5))

Month Total Admission


Jun 50
SUM(OFFSET(EH17,MATCH(EH46,EH18:EH29,0),2,2,2))

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

OFFSET (reference, rows, cols, [height], [width])


SYNTAX VLOOKUP (lookup_value, table_array, col_index_num,[range_lookup])
MATCH (lookup_value,lookup_array,[match_type])

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]..)

MIN (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

Year 2023 Enrollment


Month Courses Total Enrollment
Jan Excel 635
Feb Power Query 112
Mar Power BI 318
Apr Tableau 384
May SQL Server 392
Jun Excel 742
Jul Power Query 338
Aug Power BI 667
Sep Excel 194
Oct Power Query 158
Nov Power BI 527
Dec Excel 871

Solution:
Highest Student Enrollment
871
MAX(ET13:ET24)

Lowest Student Enrollment


112
MIN(ET14:ET25)

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

Year 2023 Enrollment


Month Courses Enrollment
Jan Excel 635
Feb Power Query 112
Mar Power BI 318
Apr Tableau 384
May SQL Server 392
Jun Excel 742
Jul Power Query 338
Aug Power BI 667
Sep Excel 194
Oct Power Query 158
Nov Power BI 527
Dec Excel 871

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]

SYNTAX: MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

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

Year 2023 Enrollment


Month Courses Course Sell
Jan Excel 635
Feb Power Query 112
Mar Power BI 318
Apr Tableau 384
May SQL Server 392
Jun Excel 742
Jul Power Query 338
Aug Power BI 667
Sep Excel 194
Oct Power Query 158
Nov Power BI 527
Dec Excel 871

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.

Year 2024 Enrollment


Month Courses Enrollment Per Course Fees Discount Rate
Jan Excel 63 2000 0.09
Feb Power Query 12 1500 0.13
Mar Power BI 31 3500 0.09
Apr Tableau 38 3000 0.19
May SQL Server 39 2500 0.20
Jun Excel 74 2000 0.20
Jul Power Query 33 1500 0.05
Aug Power BI 66 3500 0.15
Sep Excel 19 2000 0.18
Oct Power Query 15 1500 0.13
Nov Power BI 24 3500 0.09
Dec Excel 18 200 0.09

• Calculate the total revenue for course after applying the discount rate, using a formula that combines
PRODUCT with other functions

Solution:

Course Total Revenue


Excel 267496.00
SUMPRODUCT((FQ19:FQ30=FP35)*FR19:FR30*FS19:FS30*(1-FT19:FT30))

Course Total Revenue


Excel 267496.00
SUMPRODUCT(FILTER(FR19:FR30*FS19:FS30*(1-FT19:FT30),FQ19:FQ30="Excel"))

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:

Emp ID Emp Name Designation


204 Abhay Analyst
INDEX(FZ18:FZ21,MATCH(1,(FY18:FY21=FY26)*(FX18:FX21=FX26),0))

Emp ID Emp Name DOJ


204 Abhay 15/Mar/24
INDEX(GA18:GA21,MATCH(1,(FY18:FY21=FY32)*(FX18:FX21=FX32),0))

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:

You might also like