chapter 12 creating formulas that look up values microsoft excel 2003

26
Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Upload: margaret-floyd

Post on 18-Jan-2016

230 views

Category:

Documents


13 download

TRANSCRIPT

Page 1: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Chapter 12

Creating Formulas that Look Up Values

Microsoft Excel 2003

Page 2: 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.

Page 3: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 4: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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.

Page 5: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Using Lookup and Reference Functions

Function Arguments dialog box for VLOOKUP

Page 6: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 7: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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.

Page 8: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 9: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

MATCH Function• MATCH()

• Returns the relative position of a cell in a range that matches a specified value.

• Syntax:MATCH(lookupValue, lookupArray,

matchType)

Page 10: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 11: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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

Page 12: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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.

Page 13: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 14: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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)

Page 15: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Creating a Lookup FormulaAdd-Ins dialog box with the Lookup Wizard selected

Page 16: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Creating a Lookup FormulaLookup Wizard dialog box: Step 1 of 4

Page 17: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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

Page 18: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Creating a Lookup FormulaLookup Wizard dialog box: Step 3 of 4

Page 19: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Creating a Lookup FormulaLookup Wizard dialog box: Step 4 of 4

Page 20: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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

Page 21: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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

Page 22: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Using Lookup and Reference Functions

The Lookup & Reference Functions tab

Page 23: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Using Lookup and Reference Functions

Entering the Index function

Page 24: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Using Lookup and Reference Functions

Function Arguments dialog box for MATCH

Page 25: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

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.

Page 26: Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003

Using Lookup and Reference Functions

Function Arguments dialog box for INDEX