Exact vs Approximate Lookup in LibreOffice Calc

In LibreOffice Calc, retrieving data from spreadsheets relies on lookup functions configured for either exact or approximate matches. Exact matching searches for an identical value and returns an error if no match is found, whereas approximate matching locates the nearest value in a sorted dataset. This guide explains which LibreOffice Calc functions support both matching modes, how to configure their arguments, and which functions are restricted to approximate matching.


Functions Supporting Both Exact and Approximate Matches

1. VLOOKUP and HLOOKUP

VLOOKUP (vertical search) and HLOOKUP (horizontal search) use a dedicated boolean parameter to switch between exact and approximate matching.

2. MATCH

The MATCH function returns the relative position of an item in a single row or column. It supports exact matching and two directions of approximate matching via the Type argument.

3. XLOOKUP

Available in modern versions of LibreOffice Calc, XLOOKUP provides directional and wildcard controls without requiring the dataset to be sorted for basic searches.


Functions Supporting Only Approximate Matches

LOOKUP

The standard LOOKUP function is legacy-compatible and only performs approximate matching.


Summary of Parameter Values

Function Exact Match Setting Approximate Match Setting Requires Sorted Data?
VLOOKUP / HLOOKUP 0 or FALSE 1, TRUE, or omitted Only for approximate matches (Ascending)
MATCH 0 1 (less than) or -1 (greater than) Only for approximate matches
XLOOKUP 0 or omitted -1 (next smaller) or 1 (next larger) No
LOOKUP Not Supported Always enabled (Default) Yes (Ascending)