formulastreak

XLOOKUP vs FILTER

Updated · Works in: Excel 2021+, Microsoft 365, Google Sheets · Every example checked before release

Short answer

XLOOKUP returns one match per key (the first, or the last with search mode -1); FILTER returns every matching row and spills them. Use XLOOKUP for unique keys, FILTER for “all rows where…”.

Use XLOOKUP when you want one result per key, and FILTER when you want every row that matches. Both are in Excel 2021, Excel 2024, Microsoft 365 and Google Sheets. XLOOKUP stops at the first match (or the last, with search mode -1); FILTER spills all of them.

XLOOKUPFILTER
ReturnsOne match (first or last)Every matching row
Several conditionsMultiply them in the lookup arrayMultiply them in include
Nothing foundFourth argument, else #N/AThird argument, else #CALC! (Excel)
ExcelExcel 2021, 2024, Microsoft 365Excel 2021, 2024, Microsoft 365
Google SheetsYesYes (conditions as separate arguments)

First match: XLOOKUP

Who is the North rep? XLOOKUP(I1, B2:B9, A2:A9) searches the Region column and returns the first rep it finds: Amara Osei. There's a second North rep further down, and XLOOKUP never mentions her.

Q3 sales team · edit I2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI2 = Amara Osei
ABCDEFGHI
1RepRegionJulAugSepTargetRegionNorth
2Amara OseiNorth$12,400$13,100$11,800$36,000First repAmara Osei
3Ben FischerSouth$9,800$10,250$12,100$30,000
4Lina ChenEast$15,200$14,800$16,900$45,000
5Diego AlvarezWest$8,700$9,100$8,400$28,000
6Eva NovakNorth$11,200$12,600$13,900$36,000
7Farid HaddadSouth$13,300$12,900$14,100$39,000
8Grace KimEast$10,100$9,600$10,800$33,000
9Hugo MartinWest$14,500$15,800$15,100$42,000

Every match: FILTER

FILTER(A2:A9, B2:B9="North") returns both North reps, Amara Osei and Eva Novak, spilled into the cells below. Text in a condition goes in double quotes; point it at a cell instead (B2:B9=I1) and the list follows whatever region you type. Give FILTER a wider array to return whole rows.

Q3 sales team · edit I2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI2 = Amara Osei
ABCDEFGHI
1RepRegionJulAugSepTargetRegionNorth
2Amara OseiNorth$12,400$13,100$11,800$36,000All repsAmara Osei
3Ben FischerSouth$9,800$10,250$12,100$30,000Eva Novak
4Lina ChenEast$15,200$14,800$16,900$45,000
5Diego AlvarezWest$8,700$9,100$8,400$28,000
6Eva NovakNorth$11,200$12,600$13,900$36,000
7Farid HaddadSouth$13,300$12,900$14,100$39,000
8Grace KimEast$10,100$9,600$10,800$33,000
9Hugo MartinWest$14,500$15,800$15,100$42,000

Choosing between them

If the key is unique (a SKU, an employee ID), XLOOKUP is the right tool and returns one value you can use in further maths. If the key repeats (a region, a status, a customer), decide whether you want one row or all of them: XLOOKUP silently picks one, which can hide data. FILTER needs empty cells to spill into, or it shows #SPILL!. The FILTER guide and VLOOKUP vs XLOOKUP go deeper.

Which should a beginner learn first?

XLOOKUP: looking up one value is the more common job, and it's the natural next step after VLOOKUP. Learn FILTER next, because “show me every row where…” comes up as soon as you build reports. Both work in Google Sheets, so the skills carry over.

Check yourself

One real exercise from the “Dynamic arrays” unit. Checked on our server; no account needed.

List the reps who sold more than $13,000 in September, in H2.

  • Use FILTER
Select H2 and type = to start its formula (in the cell or the formula bar)
ABCDEFGH
1RepRegionJulAugSepTargetBig September
2Amara OseiNorth$12,400$13,100$11,800$36,000
3Ben FischerSouth$9,800$10,250$12,100$30,000
4Lina ChenEast$15,200$14,800$16,900$45,000
5Diego AlvarezWest$8,700$9,100$8,400$28,000
6Eva NovakNorth$11,200$12,600$13,900$36,000
7Farid HaddadSouth$13,300$12,900$14,100$39,000
8Grace KimEast$10,100$9,600$10,800$33,000
9Hugo MartinWest$14,500$15,800$15,100$42,000

Common mistakes

  • Using XLOOKUP on a key that repeats and assuming the result is the only match.

  • Typing something into the cells FILTER needs to spill into (#SPILL!).

  • Using AND() or OR() inside FILTER instead of multiplying or adding the conditions.

Questions

Can XLOOKUP return several matches?+

No, one per lookup value. For every match, use FILTER.

What does FILTER show when nothing matches?+

In Excel, #CALC! unless you give the third argument; in Google Sheets, #N/A.

Reading is step one. Now make it stick.

Practise it in a five-minute lesson on a live sheet, with instant feedback. No account needed for the free units.

Practise FILTER in the course

Sources

Official documentation the facts on this page were checked against.