Syntax
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Arguments
| Argument | Required | Description |
|---|---|---|
lookup_value | Required | The value to look for |
table_array | Required | The table; the first column is searched |
col_index_num | Required | Which column to return, from 1 |
range_lookup | Optional | TRUE (default) for the closest match in a sorted column, FALSE for an exact match |
How to use VLOOKUP
VLOOKUP takes 3 required arguments and 1 optional argument. Type =VLOOKUP( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=VLOOKUP("b", {"a",1;"b",2;"c",3}, 2, FALSE)Result =VLOOKUP(2.5, {1,"one";2,"two";3,"three"}, 2)Result =VLOOKUP("z", {"a",1;"b",2}, 2, FALSE)Result Related lookup and reference functions
- INDIRECTReturns the reference written in a text value, such as "B3" or "Sheet2!A1:A10".
- LOOKUPFinds a value in a sorted row or column and returns the value at the same position in another row or column.
- MATCHReturns the position of a value in a row or column.
- OFFSETReturns a reference shifted a number of rows and columns from a starting reference, optionally with a new size.
- ROWReturns the row number of a reference, or of the cell with the formula when left out.
- ROWSReturns the number of rows in a range or array.
- TRANSPOSESwaps the rows and columns of a range or array.
- XLOOKUPSearches a range or array for a match and returns the matching item from a second range or array.
- XMATCHReturns the position of an item in a row or column, with exact, approximate, wildcard and binary search options.