MATCH

MATCH the index of seek in vector

Synopsis

MATCH(seek,vector,type)

Arguments

seek: value to find

vector: n by 1 or 1 by n range to be searched

type: +1 (the default) to find the largest value ≤ seek, 0 to find the first value = seek, or-1 to find the smallest value ≥ seek

Description

MATCH searches vector for seek and returns the 1-based index.

Note

For type = -1 the data must be sorted in descending order; for type = +1 the data must be sorted in ascending order. If seek could not be found, #N/A is returned. If vector is neither n by 1 nor 1 by n, #N/A is returned.

See also

LOOKUP.