Syntax
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])Arguments
| Argument | Required | Description |
|---|---|---|
lookup_value | Required | The value to look for |
table_array | Required | The table; the first row is searched |
row_index_num | Required | Which row to return, from 1 |
range_lookup | Optional | TRUE (default) for the closest match in a sorted row, FALSE for an exact match |
How to use HLOOKUP
HLOOKUP takes 3 required arguments and 1 optional argument. Type =HLOOKUP( 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.
=HLOOKUP("b", {"a","b","c";1,2,3}, 2, FALSE)Result =HLOOKUP(25, {10,20,30;"x","y","z"}, 2, TRUE)Result Related lookup and reference functions
- COLUMNReturns the column number of a reference, or of the cell with the formula when left out.
- COLUMNSReturns the number of columns in a range or array.
- FORMULATEXTReturns the formula in a cell as text.
- GETPIVOTDATAReturns data from a pivot table. Refer to the pivot table cells directly instead.
- 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".
- 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.