Download presentation
Presentation is loading. Please wait.
Published byHorace Quinn Modified over 9 years ago
1
1 CSE 2337 Chapter 5 Retrieving Data with Lookups
2
2 Objectives VLOOKUP HLOOKUP LOOKUP INDEX
3
3 Lookup Tables in Excel Lookup Table – A data list that categorizes values that are needed elsewhere Better than nested ifs – extensibility Better than hard coding - redundancy
4
4 Vertical Lookups
5
5 Example Vertical Lookup Tables Goal: Given a quantity, what is the unit price?? Goal: Given a method, what is the cost per unit??
6
6 VLOOKUP VLOOKUP function –Most effective and flexible way to retrieve data organized in columns –Searches specified part of worksheet for data, starting with the first column –=VLOOKUP(lookup_value,table_array, col_index_num,range_lookup) –Must specify col_index_num
7
7 VLOOKUP Arguments
8
8 VLOOKUP Algorithm
9
9 Exact Match If using lookup type of FALSE, VLOOKUP only looks for an exact match Sorted ascending not required VLOOKUP function displays #N/A in cell if exact match is not found
10
10 Exact Match
11
11 Horizontal Lookups
12
12 Horizontal Lookup
13
13 HLOOKUP HLOOKUP function –Looks up a value by testing for a criterion across a row –HLOOKUP(lookup_value,table_array, row_index_num,range_lookup) –Must specify row_index_num Similar to VLOOKUP function, except that values are tested across the row First row of lookup table must be sorted in ascending order
14
14
15
15 HLOOKUP
16
16 Other Worksheets Use VLOOKUP and HLOOK for accessing data on other worksheets –Data may be placed on separate sheet when it is a long table
17
17 Separate Sheets
18
18 LOOKUP Use LOOKUP function –Looks up the greatest value that does not exceed a specified value anywhere in a table or range –Can retrieve data from a lookup table with a vertical or horizontal orientation –Uses only a TRUE lookup type; column or row containing lookup values must be in ascending order –LOOKUP(lookup_value,lookup_vector, result_vector)
19
19
20
20
21
21 Index Function Use INDEX function with two- or three- dimensional tables –Returns the value in a table based on row and column numbers that you specify –=INDEX(reference,row_num,column_num, area_num) –Has several guidelines – See p 305 of text…
22
22
23
23 Index
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.