LOOKDOWN

The LOOKDOWN function sequentially searches a series beginning at the end of the series, returning the last member of the series that meets a specified condition.

Syntax:
LOOKDOWN (series-object-expression , single-condition-expression)
Meaning:
LOOKDOWN (series_to_search , condition_to_evaluate)
Returns:
A single object

LOOKDOWN returns the last member of series_to_search for which condition_to_evaluate evaluates to "true"; it returns "none" if no member of series_to_search meets the condition specified by condition_to_evaluate.

Examples

  • LOOKDOWN (Account#:Customer , Company Name:Customer = "ACME")

    This example returns the Account# of Customer whose Company Name is ACME.

  • LOOKDOWN (Part#:Row:DBSelect , Model#:Row:DBSelect = ModelCode:Legacy & Serial#:Row:DBSelect > "123")

    This example returns the Part# of DBSelect where the Model# in that row matches the ModelCode of Legacy and the Serial# is greater than 123.

Related functions

  • CHOOSE
  • EXTRACT
  • LOOKUP
    Note: LOOKDOWN differs from LOOKUP in that LOOKDOWN returns the last member of series_to_search that meets the condition_to_evaluate, while LOOKUP returns the first member of series_to_search that meets the condition_to_evaluate.
  • SEARCHUP
  • SEARCHDOWN

    The LOOKDOWN function performs a sequential search on an unsorted series, starting from the end of the series. The SEARCHUP and SEARCHDOWN functions perform a binary search on a series that is sorted in ascending or descending code-page byte-order. The SEARCHUP and SEARCHDOWN functions are efficient for performing multiple searches on a large series. The LOOKDOWN function can be more efficient for performing fewer searches. Note that LOOKDOWN returns a different instance from the one returned by SEARCHUP and SEARCHDOWN if multiple instances in the series match the condition.


Feedback