beautypg.com

Lookup, 217 lookup – Apple iWork '09 User Manual

Page 217

background image

Chapter 9

Reference Functions

217

LOOKUP

The LOOKUP function finds a match for a given search value in one range, and then
returns the value in the cell with the same relative position in a second range.

LOOKUP(search-for, search-where, result-values)

Â

search-for: The value to find. search-value can contain any value type.

Â

search-where: The collection containing the values to be searched. search-where is
a collection containing any value type.

Â

result-values: An optional collection containing the value to be returned based on
the search. result-values is a collection containing any value type.

Usage Notes

Both

Â

search-where and result-values are normally included and are specified as either

multiple columns or multiple rows, but not both (one dimensional). However, for
compatibility with other spreadsheet applications, search-where can be specified as
both multiple columns and multiple rows (two dimensional) and result-values can
be omitted.
If

Â

search-where is two dimensional and result-values is specified, the topmost row or

leftmost column, whichever contains more cells, is searched and the corresponding
value from result-values is returned.
If

Â

search-where is two dimensional and result-values is omitted, the corresponding

value in the last row (if the number of columns included in the range is larger) or
column (if the number of rows included in the range is larger) is returned.

Examples

Given the following table:

=LOOKUP(”C”, A1:F1, A2:F2) returns 30.
=LOOKUP(40, A2:F2, A1:F1) returns D.
=LOOKUP(”B”, A1:C1, D2:F2) returns 50.
=LOOKUP(”D”,A1:F2) returns 40, the value in the last row that corresponds to “D.”