Syntax
=LOOKUP(lookup_value, lookup_vector, [result_vector])Arguments
| Argument | Required | Description |
|---|---|---|
lookup_value | Required | The value to look for |
lookup_vector | Required | A sorted row or column (or an array whose first row or column is searched) |
result_vector | Optional | Where to take the result from (optional) |
How to use LOOKUP
LOOKUP takes 2 required arguments and 1 optional argument. Type =LOOKUP( 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.
=LOOKUP(4.19, {4.14,4.19,5.17}, {"red","orange","yellow"})Result =LOOKUP(5, {1,2,3;"a","b","c"})Result =LOOKUP(0, {1,2,3}, {"a","b","c"})Result Related lookup and reference functions
- GETPIVOTDATAReturns data from a pivot table. Refer to the pivot table cells directly instead.
- HLOOKUPLooks for a value in the first row of a table and returns the value in the same column from another row.
- INDEXReturns the value or reference at a given row and column of a range or array.
- INDIRECTReturns the reference written in a text value, such as "B3" or "Sheet2!A1:A10".
- 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.