HLOOKUP Function (LibreOffice Calc)
Learn the HLOOKUP function in LibreOffice Calc: Horizontal search and reference to the cells located below.
The HLOOKUP function in LibreOffice Calc is used for this task: Horizontal search and reference to the cells located below. Find a value in the row under a matching table header.
This guide explains how to read the formula, reproduce a concrete example, interpret its result and recognize common input mistakes.
Syntax and arguments
HLOOKUP(search_criterion; array; index; [sorted_range_lookup])
| Argument | Required? | Meaning |
|---|---|---|
Search criterion |
Yes | The value to be found in the first row. |
Array |
Yes | The array or the range for the reference. |
Index |
Yes | The row index in the array. |
Sorted range lookup |
Optional | If the value is TRUE or not given, the search row of the array represents a series of ranges, and must be sorted in ascending order. |
Calc formulas normally use semicolons (;) between arguments in common configurations; the displayed separator may depend on settings or locale.
Worked example
For the horizontal lookup, enter:
| J | K | L | |
|---|---|---|---|
| Row 1 | Apple | Pear | Plum |
| Row 2 | 5 | 8 | 4 |
=HLOOKUP("Pear";J1:L2;2;0)
Expected result: 8.
Why it works: Find a value in the row under a matching table header. The specified sample table supplies the referenced cells.
How to use it in your own spreadsheet
- Identify the cells or inputs that correspond to the sample values above.
- Enter the formula in an empty cell, changing the references or literal values to match your sheet.
- Compare the output with a manual check on a small known example.
- Extend the formula to a larger dataset only after you understand the result.
Common problems and practical checks
- Use the correct lookup column or return range, and use exact-match options where appropriate.
- Check for duplicate keys, leading spaces and numbers stored as text in lookup data.
- A pasted formula may produce an error when it uses the other program’s argument separator or unsupported options.
Lookup tip: Use exact matching for product codes or identifiers unless you have deliberately sorted your data for approximate matching. Check the behavior when no match exists.
Related functions
Documentation and verification
- LibreOffice Calc Help
- The standalone example was calculated using LibreOffice Calc 25.2.3.2 on October 9, 2026 and its computed result matched the expected value. This does not certify every option, version, or other example.