To look up multiple columns with XLOOKUP, you have two main goals: returning values from several columns at once, or matching a value across several columns to find the first hit. For returning multiple columns, use =XLOOKUP(lookup_value, lookup_array, return_array) where return_array spans multiple columns — XLOOKUP will spill the results horizontally. For matching across multiple columns, use =XLOOKUP(1, (range1=lookup1)*(range2=lookup2), return_range) with Boolean logic. Both work in Excel 2021 and Microsoft 365.
Why XLOOKUP Changes the Game for Multiple Columns
Before XLOOKUP, returning values from multiple columns meant writing several VLOOKUP formulas (one per column) or using INDEX/MATCH with array formulas. XLOOKUP simplifies this because its third argument, return_array, can be a multi-column range. When you point it at, say, C2:E100, it returns all three columns for the matched row, spilling them into adjacent cells automatically. This is a huge time-saver and reduces formula errors.
Another advantage: XLOOKUP defaults to an exact match, and it handles lookups to the left of the return column without any special tricks. It also does not require the lookup column to be sorted, unlike VLOOKUP’s approximate match mode.
How to Return Multiple Columns with XLOOKUP
The simplest case: you want to pull several columns from a table based on one lookup value. Suppose your data has:
- Column A: Product ID
- Column B: Product Name
- Column C: Price
- Column D: Stock
You want to look up a product ID in cell G2 and return the name, price, and stock. The formula in cell H2 would be:
=XLOOKUP(G2, A2:A100, B2:D100)
This returns three values in a horizontal spill: H2 gets the name, I2 gets the price, J2 gets the stock. If you want them stacked vertically instead, wrap it in TRANSPOSE:
=TRANSPOSE(XLOOKUP(G2, A2:A100, B2:D100))
Note: The spill behavior requires Excel 365 or Excel 2021. In older versions, you would need to press Ctrl+Shift+Enter, but XLOOKUP itself is not available there anyway.
Matching Across Multiple Columns (Two-Way Lookup)
Sometimes you need to find a row that matches criteria in two or more columns. For example, you have a table with Region in column A, Product in column B, and Sales in column C. You want the sales for a specific region and product. Use a Boolean multiplication inside XLOOKUP:
=XLOOKUP(1, (A2:A100="North")*(B2:B100="Widget"), C2:C100)
Here, (A2:A100="North") returns an array of TRUE/FALSE, and multiplying by the second condition converts TRUE/FALSE to 1/0. The product is 1 only when both are TRUE, and XLOOKUP finds that 1 in the lookup array. This works because XLOOKUP can handle array calculations in its lookup_array argument.
For more complex logic, you can use the AND function inside an array formula, but the multiplication trick is concise and fast. If you have multiple possible matches, XLOOKUP returns the first one by default; use the match_mode argument (e.g., -1 for exact or next smaller) if needed.
Choosing Between XLOOKUP, INDEX/MATCH, and FILTER
XLOOKUP is not always the best tool. Here is a quick comparison:
- XLOOKUP: Best for returning a single row or multiple adjacent columns. It is simpler than INDEX/MATCH and handles arrays natively.
- INDEX/MATCH: Still useful when you need to return a value from a column that is not adjacent to the lookup column in a specific order, or when you need to perform a two-way lookup (row and column). For example,
=INDEX(C2:F100, MATCH(H2, A2:A100, 0), MATCH(I2, C1:F1, 0)). - FILTER: When you need to return multiple rows that match criteria, not just the first. For example,
=FILTER(A2:D100, (B2:B100="Widget")*(C2:C100>100))returns all matching rows.
In short, use XLOOKUP for a single match, FILTER for multiple matches, and INDEX/MATCH when you need a classic two-way lookup or are working in older Excel versions.
Common Problems and How to Fix Them
Here are frequent issues users run into:
- #VALUE! error: This often happens when the
return_arrayis not the same number of rows as thelookup_array. Ensure both ranges start on the same row and have the same height. - #N/A error: The lookup value is not found. Check for extra spaces, text vs. number formatting, or use
IFERRORto display a friendly message:=IFERROR(XLOOKUP(...), "Not found"). - Spill range is blocked: If you get a
#SPILL!error, something is in the cells where the results would spill. Clear those cells or move the formula. - Boolean logic returns 0 instead of 1: In Excel, TRUE*TRUE=1, but if you use
AND()inside an array, it does not work as expected because AND returns a single value. Stick to multiplication.
Also, remember that XLOOKUP is case-insensitive by default. If you need case-sensitive matching, use the match_mode argument with a value of 0 (exact match) and combine with EXACT in an array formula, but that is rare.
XLOOKUP vs. VLOOKUP for Multiple Columns
VLOOKUP can return only one column per formula, so to get three columns you would write three separate formulas. XLOOKUP does it in one. Also, VLOOKUP cannot look to the left; XLOOKUP can. VLOOKUP requires the lookup column to be the first column in the table; XLOOKUP does not. Finally, VLOOKUP’s approximate match can be dangerous if the table is not sorted; XLOOKUP defaults to exact match, which is safer.
If you are sharing a workbook with users on older Excel versions, VLOOKUP might be the only option. But for modern Excel, XLOOKUP is the recommended choice.
Frequently Asked Questions
Can XLOOKUP return multiple columns vertically?
Yes, wrap the XLOOKUP in TRANSPOSE to flip the spill from horizontal to vertical. For example, =TRANSPOSE(XLOOKUP(G2, A2:A100, B2:D100)) will put the results in a column.
How do I look up based on two columns without creating a helper column?
Use the Boolean multiplication method: =XLOOKUP(1, (range1=crit1)*(range2=crit2), return_range). This avoids adding a concatenated helper column, though a helper column can be easier to read for some users.
What if I want to return all columns for a match, not just a few?
Point the return_array to the entire row range. For example, =XLOOKUP(G2, A2:A100, B2:F100) returns all values from columns B through F for the matched row.
Does XLOOKUP work with wildcards?
Yes, but only if you set the match_mode argument to 2 (wildcard match). For example, =XLOOKUP("*Widget*", B2:B100, C2:C100, ,2) finds the first product containing “Widget”.
Why does my XLOOKUP return #VALUE! when I use multiple conditions?
This usually happens when the ranges in the Boolean expression are not the same size. Ensure each condition range has the same number of rows as the lookup_array. Also, avoid using AND inside array formulas; use multiplication instead.
Can I use XLOOKUP to return a value from a column to the left of the lookup column?
Yes, that is one of XLOOKUP’s advantages. The return_array can be any column, even to the left. For example, =XLOOKUP(G2, C2:C100, A2:A100) looks up in column C and returns from column A.
Related
- Traffic Light Print Out: What It Is & How to Read It
- How to Change Camera View in Blender (Orbit, Zoom, Pan)
- Computer Lab Entry Register Format: 7 Columns That Work
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel SUM Ignore Errors: Formulas for Clean TotalsYes. To sum numbers while treating error cells as zero in Microsoft Excel for Microsoft 365, use =SUM(IFERROR(B2:B6,0));…
- Excel Sum Every Other Column: Formulas and ExamplesTo sum every other column in an Excel row, use =SUMPRODUCT((MOD(COLUMN(B2:K2)-COLUMN(B2),2)=0)*B2:K2). With numbers in B2:K2, this adds B2,…
- Excel SUMIF Ignore Errors: Formula & FixesThe direct answer: Excel’s SUMIF function does not have a built-in option to ignore errors, but you can…
- Match Excel Formula for Two Columns: Compare ValuesTo compare two cells on the same row in Excel, enter =IF(A2=B2,"Match","Different") in C2 and fill it down.…
- How to Write a VLOOKUP Formula in Excel (Step-by-Step)VLOOKUP is Excel’s classic lookup function. It searches for a value in the first column of a table…
- How to Get the Average Number in Excel with a FormulaTo get the average number in Excel, enter =AVERAGE(B2:B10) in an empty cell, replacing B2:B10 with the range…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.