Google Sheets XLOOKUP: How to Return Multiple Results

Master how to return multiple results in Google Sheets using FILTER and QUERY. Learn patterns, formulas, and practical tips to simulate XLOOKUP-style multi-match lookups with safe, scalable approaches.

How To Sheets
How To Sheets Team
·5 min read
Quick AnswerDefinition

In Google Sheets, you can return multiple matches for a lookup by using array-enabled functions like FILTER and QUERY. There is no single native XLOOKUP that spills results by itself; instead, you build an array formula to pull all rows that meet your criteria. This guide walks you through patterns, examples, and best practices.

Understanding the challenge: retrieving multiple matches from a single key

In many data tasks, a single lookup key can correspond to multiple results. For Google Sheets users, the challenge is to return all matching rows without resorting to manual copying. While there isn’t a one-click XLOOKUP in Sheets that spills an array of results by default, you can achieve the same outcome with powerful, well-documented patterns. These patterns leverage native array-aware functions like FILTER and QUERY, plus a few helpers to control order and format. According to How To Sheets, the most reliable approach is to build a small toolbox of lookups that return complete result sets rather than a single value. The following examples demonstrate practical formulas you can adapt to your datasets.

Excel Formula
=FILTER(B2:B100, A2:A100 = "Alice")
Excel Formula
=FILTER({B2:B100, C2:C100}, A2:A100 = "Alice")
  • The first example returns all matching values from column B where the key in A equals Alice.
  • The second example returns two columns (B and C) for each matching row, preserving the relationship across columns.

Basic pattern: FILTER as the workhorse for multi-result lookups

The FILTER function is the bread-and-butter for multi-result lookups in Sheets. It returns all rows that satisfy a condition, which makes it ideal for pulling every match for a given key. You can extend it to multiple columns by wrapping your data in an array literal. As you build more complex sheets, consider adding sorting or deduplication to make the results easier to scan.

Excel Formula
=FILTER(A2:D100, E2:E100 = "Active")
Excel Formula
=FILTER({A2:A100, B2:B100, C2:C100}, D2:D100 = "2026-04-01")
  • Variants: use multiple criteria by multiplying conditions (A2:A100 = "Alice") * (D2:D100 > 0).
  • If no rows match, FILTER returns an error; wrap with IFNA for clean handling.

Using QUERY for flexible selection

QUERY provides SQL-like syntax to filter, sort, and select specific columns. It shines when you want precise column selection, concatenation, or aggregation during a multi-result lookup. You can reference a lookup value from a cell, enabling dynamic reports.

Excel Formula
=QUERY(A1:D100, "select B, C where A = 'Alice'", 1)
Excel Formula
=QUERY(A1:D100, "select B, sum(D) where A matches 'Alice|Alicia' group by B label sum(D) 'Total'", 1)
  • Use quotes carefully with concatenation to keep the query dynamic.
  • The third parameter (headers) should match your data. If omitted, headers may be inferred incorrectly.

Returning results across multiple columns and expanding results with ARRAYFORMULA

For very large ranges, ARRAYFORMULA can help ensure your formulas spill correctly as data changes. While FILTER already returns arrays, wrapping the output ensures compatibility with older sheets or more complex layouts.

Excel Formula
=ARRAYFORMULA(FILTER({B2:B1000, C2:C1000}, A2:A1000 = $A$2))
Excel Formula
=ARRAYFORMULA(QUERY(A1:D1000, "select B, C where A = 'Alice'", 1))
  • ARRAYFORMULA converts a scalar function into an array-enabled one.
  • Use logical checks to avoid unintended matches when data grows.

Handling duplicates and ordering with SORT and UNIQUE

Sometimes you need a clean list of unique matches or a specific order. Combine FILTER with SORT and UNIQUE to control results without duplicating values.

Excel Formula
=UNIQUE(SORT(FILTER(B2:B100, A2:A100 = "Alice")))
Excel Formula
=ARRAYFORMULA(SORT(UNIQUE(FILTER({B2:B100, C2:C100}, A2:A100 = "Alice")), 1, TRUE))
  • Use SORT to order results by the primary column; specify ascending/descending with TRUE/FALSE.
  • UNIQUE removes duplicate rows, improving readability.

Dealing with no matches gracefully

Users often want friendly messages when no results exist. IFNA or IFERROR can suppress error messages and present a clear alternative. This makes dashboards robust and user-friendly.

Excel Formula
=IFNA(FILTER(B2:B100, A2:A100 = "Nonexistent"), "No results for that key")
Excel Formula
=IFERROR(FILTER({B2:B100, C2:C100}, A2:A100 = "Nonexistent"), {"No results" , ""})
  • Customize the message to fit your UI; avoid exposing internal data structures when sharing reports.

Real-world scenarios: sales, inventory, and student records

The same patterns apply across domains. Suppose you want all order amounts for a given customer and date, or all inventory items for a specific category. By combining FILTER with appropriate column selections, you can deliver comprehensive multi-row results without scripting.

Excel Formula
=FILTER(Sales!B2:B100, (Sales!A2:A100 = $A$2) * (Sales!D2:D100 >= date '2026-01-01'))
Excel Formula
=QUERY(Inventory!A1:D100, "select B, C, D where A = 'Widget' order by D desc", 1)
  • Use relative references to keep formulas portable across sheets.
  • For cross-sheet lookups, ensure ranges are consistently sized and named where possible.

Performance notes for large datasets

As data grows, performance becomes a consideration. Prefer limiting the range to the actual data rather than entire columns, and use named ranges to improve readability and reduce recalculation overhead. Consider pre-filtering data with a separate helper table if your main sheet becomes sluggish.

Excel Formula
=FILTER(Inventory!B2:B5000, Inventory!A2:A5000 = "Gadget")
Excel Formula
=QUERY(Inventory!A1:D5000, "select B, C where A = 'Gadget'", 1)
  • Avoid volatile functions inside these lookups when possible.
  • Document the logic with comments or a data dictionary to help future maintainers.

Best practices and common pitfalls

Keep your lookup logic explicit and well-documented. Maintain consistency in data types (text vs numbers) and handle empty cells gracefully. When combining multiple criteria, group conditions clearly to avoid unintended matches. Finally, test formulas with edge cases (no matches, many matches, and duplicates) before deploying in dashboards.

Quick-start checklist and quick wins

  • Start with a simple FILTER formula to verify basic multi-result behavior.
  • Add a second column to see relation data alongside primary results.
  • Introduce SORT/UNIQUE to improve readability.
  • Wrap with IFNA to manage empty lookups gracefully.
  • Consider QUERY for more advanced formatting or aggregation.

Steps

Estimated time: 20-40 minutes

  1. 1

    Prepare your dataset

    Organize your data with a stable key column and at least one value column. Ensure there are no stray headers within the data range you plan to query.

    Tip: Define a clear key column; avoid mixed data types that could cause mismatches.
  2. 2

    Choose a lookup pattern

    Decide whether you need a simple multi-match with FILTER or a more structured result with QUERY. This sets the foundation for the formula you’ll write.

    Tip: For quick results, start with FILTER before moving to QUERY for more control.
  3. 3

    Build the core formula

    Write a basic FILTER to pull all matches for a given key. Test with a known key to verify all rows are returned.

    Tip: Use the lookup cell reference so the result updates dynamically.
  4. 4

    Extend to multiple columns

    Wrap the FILTER with an array literal to return related columns together. This preserves row relationships across columns.

    Tip: Always verify the alignment of columns in the array literal.
  5. 5

    Handle edge cases and finalize

    Add IFNA/IFERROR to gracefully handle no matches. Consider sorting or deduplicating if needed for readability.

    Tip: Document edge cases in comments or a data dictionary.
Pro Tip: Test formulas on a small subset of data before applying to the full dataset.
Warning: Be mindful of data types; numeric IDs stored as text can cause missed matches.
Note: Named ranges can improve readability and reduce maintenance effort.

Prerequisites

Required

Optional

  • Optional: access to a sample dataset or workbook provided in this guide
    Optional

Keyboard Shortcuts

ActionShortcut
CopyCopy selected cell(s) or rangeCtrl+C
PastePaste into cell(s)Ctrl+V
Find in sheetSearch within the current sheetCtrl+F
Fill downCopy the formula or value from the cell aboveCtrl+D

FAQ

Can I return multiple results for a single lookup in Google Sheets?

Yes. Use array-enabled functions like FILTER or QUERY to return all matching rows for a given key. You can also combine these with SORT or UNIQUE for nicer output. The approach shown here emphasizes keeping relationships between columns intact.

Yes. You can return multiple matches using FILTER or QUERY to pull every row that matches the key.

What is the best function to get all matches quickly?

For quick multi-match lookups, start with FILTER and, when you need formatting or aggregation, use QUERY. Both handle multiple results well; choose based on whether you need column control (QUERY) or simplicity (FILTER).

FILTER is great for quick multi-match lookups; QUERY gives you more control when formatting results.

How do I sort the results in a multi-match lookup?

Wrap your lookup with SORT, or incorporate an ORDER BY clause in QUERY. This ensures results appear in a predictable order, improving readability and downstream processing.

Sort the results with SORT or use QUERY's order by to keep things tidy.

What if there are no matches?

Use IFNA or IFERROR around your lookup to display a friendly message or fallback value instead of an error. This makes dashboards robust.

Use IFNA to show a friendly message when there are no matches.

Can I return results from more than one column at once?

Yes. Use an array constant like {col1, col2} inside FILTER or use QUERY to select multiple columns. This keeps related fields aligned per row.

Absolutely—return multiple columns by using array literals or selecting multiple columns in QUERY.

How does performance scale with dataset size?

Performance depends on range size and formula complexity. Prefer limiting ranges to actual data, avoid volatile formulas, and consider pre-filtering when working with very large datasets.

Performance scales with data size; limit ranges and avoid excessive complexity.

The Essentials

  • Use FILTER for multi-result lookups
  • QUERY offers flexible selection and formatting
  • Sort and UNIQUE can clean up results
  • Handle no matches with IFNA/IFERROR

Related Articles