Use the
lookup, hlookup, vlookup and
match functions to find values in vectors or matrices and return the corresponding entries from the same or from another array.
Searching Through One Matrix
1. Define the following car survey matrix.
The rows represent the model number, the percentage of the market, the crash test rating, and the average cost per car in $.
2. Call the lookup function to find the model numbers of cars that have an average price of $30000
3. Call the hlookup function to find the cost of model #4.
4. Call the vlookup function to find the market percentage of model #9. Transpose the matrix of data since vlookup searches through columns and not through rows as for hlookup.
5. Use the match function to find the indices of cars that have an average price of $25000.
The cars matrix has an average price of $25000 at these indices.
Searching Through Two Matrices
1. Create matrices containing the cost of the cars and their corresponding crash test rating.
For these two tables, the rows represent the different types of cars. The columns represent the different brands.
2. 2. Use the lookup function to search for cars with an average cost of $25000 in one grid and to return the corresponding crash test rating from the other grid.