chapter 12 creating formulas that look up values microsoft excel 2003
TRANSCRIPT
Chapter 12
Creating Formulas that Look Up Values
Microsoft Excel 2003
Using Lookup Tables
• A lookup table differs from a worksheet list in that it typically provides both row and column labels, as opposed to a single field header row.
• An important layout tip for lookup tables is to ensure that the value you want to use for locating data is placed in the leftmost column or topmost row of the table.
Basic Lookup Formulas
• VLOOKUP()
• Looks up the value in the first column of the lookup table and returns the corresponding value in a specified table column.
• Arranged vertically.
• Syntax:VLOOKUP(lookupValue, tableArray,
colIndexNum, rangeLookup)
VLOOKUP Arguments
• lookupValue – the value to be looked up in the first column of the lookup table (text value - can include wildcard characters)
• tableArray – the range that contains the lookup table
• colIndexNum – the column number within the table from which the matching value is returned
• rangeLookup – optional; If TRUE or omitted, an approximate match is returned (the next largest value less than the lookup value); if FALSE, VLOOKUP will search for an exact match. If one is not found, the function returns #N/A.
Using Lookup and Reference Functions
Function Arguments dialog box for VLOOKUP
Basic Lookup Formulas
• HLOOKUP()
• Looks up the value in the first row of the lookup table and returns the corresponding value in a specified table row.
• Arranged horizontally.
• Syntax:HLOOKUP(lookupValue, tableArray,
rowIndexNum, rangeLookup)
HLOOKUP Arguments
• lookupValue – the value to be looked up in the first row of the lookup table (text value - can include wildcard characters)
• tableArray – the range that contains the lookup table
• rowIndexNum – the row number within the table from which the matching value is returned
• rangeLookup – optional; If TRUE or omitted, an approximate match is returned (the next largest value less than the lookup value); if FALSE, VLOOKUP will search for an exact match. If one is not found, the function returns #N/A.
Basic Lookup Formulas• LOOKUP()• Looks in a one-row or one-column range
(lookupVector) for a value(lookupValue) and returns a value from the same position in a second one-row or one-column range (resultVector).
• Values in the lookupVector must be in ascending order.
• If lookupValue is smaller than the smallest value in the lookupVector, LOOKUP returns #N/A.
• Syntax:LOOKUP(lookupValue, lookupVector,
resultVector)
MATCH Function• MATCH()
• Returns the relative position of a cell in a range that matches a specified value.
• Syntax:MATCH(lookupValue, lookupArray,
matchType)
MATCH Arguments
• lookupValue – the value you want to match in lookupArray. – If matchType is 0 and the lookupValue is text, this
argument can contain wildcards.
• lookupArray – the range being searched• matchType – An integer (-1, 0, or 1) that
specifies how the match is determined– (1): finds the largest value <= lookupValue
(lookupArray must be in ascending order)– (0): finds the first value exactly equal to
lookupValue.– (-1): finds the smallest value >= lookupValue
(lookupArray must be in descending order)
INDEX Function• INDEX()
• Returns a cell from a range.
• Syntax:INDEX(array, rowNum, colNum)
• Arguments– array – a range– rowNum – a row number within array– colNum – a column number within array
MATCH & INDEX Together
• The MATCH & INDEX functions are used together to perform lookups.– MATCH searches a range for a lookup
value. • It returns the relative row number where the
value is found.
– This value is then used as the second argument for the INDEX function.
• The result is the corresponding value in a different range.
Specialized Lookup Formulas
• Looking up an exact value– Use the VLOOKUP or HLOOKUP functions
with the optional 4th argument set to FALSE.
• Looking up a value to the left– Use the MATCH & INDEX functions (pg 259)
• Performing a case-sensitive lookup– Use the MATCH & INDEX functions (pg 260)
• Choosing among multiple lookup tables– Use an IF function as the second argument in
the VLOOKUP function (pg 261)
Specialized Lookup Formulas
• Performing a two-way lookup– Use the MATCH & INDEX functions (pg 263-264)
• Performing a two-column lookup– Use the MATCH & INDEX functions (pg 265-266)
• Determining the cell address of a value within a range– Use the ADDRESS function with the MATCH function
(pg 266-267)
• Looking up a value by using the closest match– (pg 267-268)
Creating a Lookup FormulaAdd-Ins dialog box with the Lookup Wizard selected
Creating a Lookup FormulaLookup Wizard dialog box: Step 1 of 4
Creating a Lookup FormulaLookup Wizard dialog box: Step 2 of 4
Select the row label heading for searching
Select the column label heading for searching
Creating a Lookup FormulaLookup Wizard dialog box: Step 3 of 4
Creating a Lookup FormulaLookup Wizard dialog box: Step 4 of 4
Creating a Lookup FormulaUsing Range Finder to view the lookup formula
Range Finder uses colors to display the relevant cell ranges in the formula
Lookup formulas created using the Lookup Wizard utilize the INDEX and MATCH built-in functions
Creating a Lookup FormulaDisplaying the Error Checking Options button’s menu
Use the menu to access context-sensitive help or to use Excel 2003’s auditing features
Using Lookup and Reference Functions
The Lookup & Reference Functions tab
Using Lookup and Reference Functions
Entering the Index function
Using Lookup and Reference Functions
Function Arguments dialog box for MATCH
Using Lookup and Reference Functions
Select Arguments dialog box
The INDEX function provides two syntax formats for returning different results. The array syntax returns a cell’s contents, while the reference syntax returns a cell’s address.
Using Lookup and Reference Functions
Function Arguments dialog box for INDEX