← All how-to recipes

How to return ALL matches, not just the first (VLOOKUP for multiple results)

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

A lookup that lists every row matching the key — where VLOOKUP/XLOOKUP stop at one.

The formula

AppFormulaNotes
Excel (desktop)=FILTER(B2:B6,A2:A6="East")Excel 365/2021. Spills one row per match; wrap in TEXTJOIN to get a single cell.
Google Sheets=FILTER(B2:B6,A2:A6="East")Identical.
LibreOffice Calc=FILTER(B2:B6,A2:A6="East")Needs LibreOffice 24.8+; older versions need the legacy SMALL/IF array pattern.

How it works

Lookups return one result by design; FILTER returns the whole set — all three East values spill down in source order. Combine as needed: TEXTJOIN(", ",TRUE,FILTER(...)) for one cell, SORT(FILTER(...)) for ordered output, or filter several columns at once by widening the first range. This one formula replaces the notoriously fragile Ctrl+Shift+Enter SMALL/IF/ROW construction from the pre-dynamic-array era.

Verified, not just documented

We ran =FILTER(B2:B6,A2:A6="East") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 150, 80, 200 — 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 150, 80, 200 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

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

Related recipes

Related comparisons