Microsoft Excel 2010 - Level 3
CHAPTER 1 LOOKUP FUNCTIONS
INFOCUS
WPL_E831
Excel provides a number of functions that allow you to look up and
extract data from a list or table. These are known as Lookup
functions and they can be used for a variety of purposes, such as:
returning the appropriate tax rate based on salary
returning the data that is at, say, the second column, third
row of a table
returning the description, price and discount rate of an item,
based on its code in the data inventory
In this session you will:
gain an understanding of data lookup functions
learn how to use CHOOSE
learn how to use VLOOKUP
learn how to use VLOOKUP for exact matches
learn how to use HLOOKUP
learn how to use the INDEX function
learn how to use MATCH
gain an understanding of reference functions
learn how to use ROW and ROWS
learn how to use COLUMN and COLUMNS
learn how to use ADDRESS
learn how to use INDIRECT
learn how to use OFFSET.
© Watsonia Publishing Page 1 Lookup Functions
Microsoft Excel 2010 - Level 3
UNDERSTANDING DATA LOOKUP FUNCTIONS
Data lookup functions are used to retrieve data part of a table of information which can be referred
from a table. They generally require at least two to as a calculation area. The where to look for it is
pieces of information; what to look for and where known as a data table a table in which a list of
to look for it. The what to look for part is often rates, figures, text or other items are held.
1 Data Area
The data area is often on a worksheet by itself, protecting it from accidentally being modified or
deleted. It holds all of the possible values for the data. The values are laid out in a table format and
they are listed in numerical or alphabetical order of the code that the lookup function will search for.
In this example, we have created the name Pay_Rates for the range B3:C7 that holds the data. The
resulting formula in the calculation area will be easier to understand.
The name Pay-Rates
has been created as a
quick way to reference
the data table in the
range B3:C7
2 Calculation Area
The calculation area is usually on a worksheet by itself unless you require the data values to be
visible as well as the resulting calculations.
The calculation area uses a formula, such as VLOOKUP, to find the correct data for each situation.
In this example, the VLOOKUP function shown is comparing the value in C5 with the values in the
range Pay_Rates. It then returns the value in the second column of the data table, determined by
the 2 in the formula.
The formula here takes the Pay
Scale value in C5 (i.e. 2) and finds
the corresponding row in the
Pay_Rates table (i.e. B4). It then
returns the value in the second
column of the corresponding row of
the Pay-Rates table, which in this
ca e $30.00
© Watsonia Publishing Page 2 Lookup Functions
Microsoft Excel 2010 - Level 3
USING CHOOSE
The CHOOSE function is designed to allow you the list of the item you want, that is, 1 being the first
to make a choice from a list of items. It takes the item in the list and so on. Range names are often
format of CHOOSE(lookup-value, list of items) used for the list items to make the function easier to
where the lookup-value indicates the position in read and comprehend.
1
Try This Yourself:
Before starting this exercise you
Open
File
MUST open the file E831
Lookup Functions_1.xlsx...
Click on the drop-arrow of the
Name Box and click on Rate_1
The hourly payroll rates have
been placed on the Payroll
Tables worksheet and each rate
has been given a separate
a e
Click on C4 to see that the
second rate has been named
Rate_2
Click on the Payroll worksheet
tab, then click on D5
We e CHOOSE to look up
e a ae
Type =CHOOSE(C5,Rate_1,
Rate_2,Rate_3,Rate_4,Rate_5)
Press
Click on D5, then copy the
formula down the list by double-
clicking on the fill handle in the 6
bottom right-hand corner of the
Note: As you type the formula, you will see the range
cell
names appear in a list below the formula. You can click on
The hourly rates and the a name in the list and press to insert it, rather than
resulting calculated gross pay g eac e
are now complete
For Your Reference Hand to Kno
CHOOSE(index_num,value1,value2,...) When you set up a data area for the
CHOOSE function, the labels or values to the
This function selects a number, cell reference,
left of the data play no particular role other
defined name, formula, function, or text from a list
than to describe the values listed. This is in
of up to 254 different options. The index_num
contrast to other lookup functions which
indicates which of the values to select, based on
search the first column of a data table for a
their position in the list.
match.
© Watsonia Publishing Page 3 Lookup Functions
Microsoft Excel 2010 - Level 3
USING VLOOKUP
The classic lookup function is VLOOKUP the then looks across the table to the column you have
vertical lookup. This function searches vertically specified to find the value to return. This is ideal for
down a sorted data table looking for a match with looking up numeric values within a range, such as
the lookup-value (or the next lowest value). It tax rates, or commission amounts.
1
Try This Yourself:
Continue using the previous file
Same
File
with this exercise, or open the file
E831 Lookup Functions_2.xlsx...
Click on the drop arrow for the
Name Box and select Tax_Table
This is the data table for our
VLOOKUP f c
Click on the Payroll worksheet
tab to return to the payroll table
and click on G5
Type 4
=VLOOKUP(F5,Tax_Table,2)
Press
0% appears because the Gross
Pa e a $500
Copy the formula in G5 to the
range G6:G13
Enter the formula =F5*G5 in H5,
then copy it to H6:H13
Enter the formula =F5-H5 in I5,
then copy it to I6:I13
Click on C10
Type 2 and press
The change in the Pay Scale
results in changes to the Hourly
Rate, Gross Pay, Tax Rate, Tax
and Net Pay for Alana Keane
For Your Reference Hand to Kno
VLOOKUP(lookup_value,table,col_index_num) An alternative to the VLOOKUP function is
the horizontal or HLOOKUP function. This
This function searches down the left-most column
looks for a value in the top row of a table or
of the table until it finds the lookup-value or the
array of values, and returns the value from
row with the next lowest value. It then refers to the
the same column in the row you specify.
column index number nominated in the function,
and returns the value found in the corresponding
row and column.
© Watsonia Publishing Page 4 Lookup Functions
Microsoft Excel 2010 - Level 3
USING VLOOKUP FOR EXACT MATCHES
Generally, the VLOOKUP function uses three may only want to return a value if you get an exact
arguments: the lookup-value, the table location match, and the optional fourth argument, match-
and the column number. This lookup will find a type, makes this possible. By adding FALSE to the
row based on a numeric range. However, you function, #NA i e ned if a ma ch i n fo nd.
Try This Yourself:
Continue using the previous
Same
file with this exercise, or open
File
the file E831 Lookup
Functions_3.xlsx...
Click on the drop arrow for
Name Box and click on
Items_List 3
This lookup table includes
specific product codes that
e e a e ac a c
Click on the Invoice worksheet
tab, then click on C7
We e e e ac lookup to
find the description
Type =VLOOKUP
(B7,Items_List,2,FALSE)
Click on E7, type
=VLOOKUP(B7,Items_List,3, 6
FALSE), then press
We only want to charge a
deposit if B3 is not blank
Click on F7, type
=IF(ISBLANK($B$3),0,
VLOOKUP(B7,Items_List,4,
FALSE)), then press
Click on G7, type =(D7*E7)*(1-
F7), then press
Copy the formulas in columns
C, E, F and G down to Row 10
to complete the invoice as
shown
7
For Your Reference Hand to Kno
To use VLOOKUP for exact matching: You can use the ISNA(value) function to trap
#NA results. For example, the structure
VLOOKUP(lookup_value,table,col,range_lkup)
=IF(ISNA( ), C de f d, )
Use the value of FALSE for range_lkup when you will display a useful message when an exact
want to ensure exact matches only. #NA will be match is not possible, rather than #NA which
e ned if an e ac ma ch i n fo nd. does not explain the problem clearly.
© Watsonia Publishing Page 5 Lookup Functions