Contact

XLOOKUP Function (LibreOffice Calc)

Lookup Intermediate LibreOffice Calc LibreOffice 24.8

Learn the XLOOKUP function in LibreOffice Calc: Extended vertical search and reference to indicated cells.

Verification status: Selected examples were executed in LibreOffice Calc 25.2. Other examples may rely on documentation or independent calculations. How formula examples are checked

Availability and version history

  • Introduced: LibreOffice 24.8.
  • Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

The XLOOKUP function in LibreOffice Calc is used for this task: Extended vertical search and reference to indicated cells. Return a matching value without specifying a result column index.

This guide explains how to read the formula, reproduce a concrete example, interpret its result and recognize common input mistakes.

Quick answer: Retrieve a product price with an explicit not-found message. The following example was run in LibreOffice Calc 25.2.3.2, not simulated or inferred from a formula description.

Enter the sample data

The downloadable workbook uses these exact rows on its Example sheet. Enter the values or download the editable XLOOKUP ODS practice workbook instead.

Sheet row A: SKU B: Item C: Price D: Stock
5 P-101 Pen 2.5 50
6 P-102 Notebook 6.25 40
7 P-103 Folder 4.75 30
8 P-104 Mouse 24.5 12
9 P-105 Cable 9.95 22
10 P-106 Stand 18 9

Formula and result

Select E5 in the practice workbook. The formula is:

=XLOOKUP("P-104";A5:A10;C5:C10;"Not found";0)

Verified output: 24.50. XLOOKUP searches only the SKU column and returns from the price column, without needing a column-index number.

Genuine LibreOffice Calc 25.2 screenshot of XLOOKUP using sample spreadsheet data; E5 shows 24.50 and the formula bar shows the tested formula

Screenshot captured from LibreOffice Calc 25.2.3.2. The formula, input values and E5 result are visible in the actual application.

Second example you can try

The workbook also includes this independently tested variation in E12:

=XLOOKUP("P-999";A5:A10;C5:C10;"Not found";0)

Verified output: Not found. Change the related input cell and press Enter to see the result update.

Common mistake: XLOOKUP is available in LibreOffice 24.8+. Older Calc versions cannot evaluate this function.

Official documentation: LibreOffice Calc reference for XLOOKUP. Test scope: These two worked examples were recalculated in Calc 25.2.3.2; other historical formulas elsewhere on this page may still require separate testing. This file includes no generated or artificial application screenshot.

Syntax and arguments

XLOOKUP(search_criterion; search_array; result_array; [result_if_not_found]; [match_mode]; [search_mode])
Argument Required? Meaning
Search criterion Yes The value to be found in the first column.
Search Array Yes The array or range to search.
Result Array Yes The array or range to return.
Result if not found Optional If given, return given text, otherwise return #N/A.
Match Mode Optional 0 - Exact match. Will return #N/A if no match. (default). -1 - Exact match or the next smaller item. 1 - Exact match or the next larger item. 2 - Wildcard match. 3 - Regular expression match.
Search Mode Optional 1 - Search from the first value (default). -1 - Search from the last value (reverse). 2 - Binary search values sorted in ascending order. -2 - Binary search values sorted in descending order.

Calc formulas normally use semicolons (;) between arguments in common configurations; the displayed separator may depend on settings or locale.

Worked example

For a product lookup, enter the following into cells F1:G3:

F (Product) G (Price)
Apple 5
Pear 8
Plum 4
=XLOOKUP("Pear";F1:F3;G1:G3)

Expected result: 8.

Why it works: Return a matching value without specifying a result column index. The specified sample table supplies the referenced cells.

How to use it in your own spreadsheet

  1. Identify the cells or inputs that correspond to the sample values above.
  2. Enter the formula in an empty cell, changing the references or literal values to match your sheet.
  3. Compare the output with a manual check on a small known example.
  4. 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.

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.