LOOKUP Function
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 "])
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
key |
Required |
String |
The string that you want to look up. |
list |
Required |
String |
The list in which you want to search. |
delimiter |
Optional |
String |
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. |
Return value
Numeric
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 expressions that can 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.