
The left column must be sorted in mode 1, with text coming after numbers. at does not match any whole cell contents, but it matches part of cat. VLOOKUP("at" A1:B5 2 0) returns #N/A if ' Search criteria = and must apply to whole cells' is enabled and C otherwise.

cat matches so does mat, but the match nearest the top is always found in mode 0. VLOOKUP(".at" A1:B5 2 0) returns C if regular expressions are enabled. The dot '.' stands for 'any single character' in a regular expression, so c.t matches cat. VLOOKUP("c.t" A1:B5 2 0) returns C if regular expressions are enabled (and #N/A if not). The difference between lower and upper case is ignored, so CAT matches cat. The left column happens to be sorted, but this is not necessary in mode 0. The contents of the corresponding cell in the 2 nd column (that is, B1) are returned. In these examples, cells A1 to A5 contain 3, 5, cat, mat, matter, and cells Matching is always case-insensitive - the case setting on the Tools - Options - Calc - Calculate dialog does not apply. If ' Search criteria = and must apply to whole cells' is enabled on the Tools - Options - Calc - Calculate dialog, lookupvalue must match the whole text in the cell if not, it can match just part of the text. This only makes sense, and should only be used, if mode is 0 or FALSE. If regular expressions are enabled on the Tools - Options - Calc - Calculate dialog, VLOOKUP will find exact matches treating lookupvalue as a regular expression. If there is no exact match, the row above where value would appear in the left column is found the #N/A error results if that row is not in the table. If there is an exact match, that is the row found if there is more than one exact match, the row found is not necessarily nearest the top. VLOOKUP decides where in the left column lookupvalue would appear.

If mode is 1 or TRUE, or is omitted, the left column of datatable must be sorted, with numbers in ascending order appearing before text values in alphabetic order. If mode is 0 or FALSE, the left column of datatable may be unordered, and the first exact match is found (searching from the top). When a value is matched in the left column, VLOOKUP returns the corresponding value (in the same row) in the columnindex th column of datatable, where columnindex = 1 is the left column. VLOOKUP(lookupvalue datatable columnindex mode) lookupvalue is a value (number, text or logical value) to look up in the left column of the range/array datatable. Returns a value from a table column, in the row found by lookup in the first column.
