← All how-to recipes

How to use XLOOKUP

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

The modern lookup — exact match by default, looks in any direction, and handles not-found gracefully.

The formula

AppFormulaNotes
Excel (desktop)=XLOOKUP(D2,A2:A10,B2:B10,"Not found")lookup value, lookup range, return range, [if not found]. Needs Excel 2021+/365.
Google Sheets=XLOOKUP(D2,A2:A10,B2:B10,"Not found")Identical.
LibreOffice Calc=XLOOKUP(D2,A2:A10,B2:B10,"Not found")Needs LibreOffice 24.8+; earlier versions use INDEX/MATCH.

How it works

XLOOKUP takes the value to find, the range to search, and the range to return from as three separate ranges — so unlike VLOOKUP there's no column-counting and the lookup and return columns can be in any order (it looks left just as easily as right). "cherry" is found in A2:A4 and 30 is returned from the matching row of B2:B4. The optional fourth argument is the not-found result ("Not found" here) instead of an ugly #N/A. It also defaults to exact match, so there's no FALSE to remember. XLOOKUP needs a modern version (Excel 2021+/365, current Google Sheets, or LibreOffice 24.8+); on older ones, INDEX/MATCH does the same job.

Verified, not just documented

We ran =XLOOKUP(D2,A2:A4,B2:B4,"Not found") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 30 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 30 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

XLOOKUP — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons