LOOKUP function

LOOKUP function

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also

Returns a zero-based index that indicates the location of the substring key in a list, or returns -1 if the target string contains the delimiter.

Syntax

LOOKUP("key","list"[,"delimiter"])

key

The string that you want to look up.

list

The list in which you want to search.

delimiter

The string to use as a delimiter within list. A delimiter string can be more than one character in length and may include multibyte characters. The default is a semicolon.

Remarks

The LOOKUP function uses a case-insensitive search. If the list begins or ends with a delimiter, a null string is assumed to exist before or after the list. Consecutive delimiters imply a null string in between.

All the arguments must be strings or able to be converted to strings. If they are not, an empty string is substituted for the offending argument.

Example 1

LOOKUP("rat","cat;rat;;goat")

Returns 1.

Example 2

LOOKUP("",";cat;rat;;goat")

Returns 0.

Example 3

LOOKUP("t","cat;rat;;goat","a")

Returns 3.