How to VLOOKUP with a partial match (contains)
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Find a row when you only know part of the key — a fragment of a name, code, or title.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =VLOOKUP("*"&D2&"*",A2:B10,2,FALSE) | Wildcards work in exact-match mode. XLOOKUP needs match_mode 2 for wildcards. |
| Google Sheets | =VLOOKUP("*"&D2&"*",A2:B10,2,FALSE) | Identical. |
| LibreOffice Calc | =VLOOKUP("*"&D2&"*",A2:B10,2,FALSE) | Identical (wildcards must be enabled in Calc options — they are by default for xlsx files). |
How it works
Wrapping the fragment in asterisks turns it into a contains-pattern: "*Turing*" matches "Alan Turing" and returns 1912. The wildcards only fire in EXACT-match mode (FALSE) — the mode people think of as the strict one. First match wins when several rows contain the fragment; ~ escapes a literal * or ? in the data. In XLOOKUP the same needs match_mode 2, and case never matters.
Verified, not just documented
We ran =VLOOKUP("*"&D2&"*",A2:B4,2,FALSE) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 1912 — 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 1912 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
VLOOKUP — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to use VLOOKUP (and the FALSE you must not forget)
- How to reference a cell on another sheet
- How to VLOOKUP from another sheet