XLOOKUP Return Array: What It Means and How It Works
In this article
The "return array" in XLOOKUP is the third argument of the function: the range or array of values that XLOOKUP hands back when it finds a match. In the syntax =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]), the return array is the column or row you want the answer from. It is not a special data type or a separate feature — it is simply the range you point to. If you are looking up a product code in column A and want the price from column D, column D is your return array.
Background: Where the Term Comes From
XLOOKUP was introduced by Microsoft as a replacement for VLOOKUP and HLOOKUP, and the terminology follows from that design. Older lookup functions used a single table array plus a column index number, which meant you had to count columns and could easily pick the wrong one. XLOOKUP splits that into two explicit ranges: the lookup array (where to search) and the return array (what to bring back). Microsoft's own documentation uses these exact labels, so "return array" is standard spreadsheet terminology, not slang or informal shorthand. It appears in the function's argument tooltip and in Excel help pages, and it is the same concept in Google Sheets' XLOOKUP implementation.
The word "array" here is used loosely. In practice the return array is almost always an ordinary cell range such as D2:D100. It only behaves like a true array when you pass something like CHOOSE({1,2}, D2:D100, E2:E100) to return multiple columns at once.
How the Return Array Works in Practice
XLOOKUP searches the lookup array for the lookup value, notes the position of the match, and then returns the value at the same position in the return array. The two ranges do not need to sit next to each other, and the return array can be to the left of the lookup array — something VLOOKUP cannot do.
A worked example: suppose A2:A100 holds employee IDs, B2:B100 holds names, and F2:F100 holds email addresses. The formula =XLOOKUP("E1042", A2:A100, F2:F100) searches for the ID in column A and returns the matching email from column F. Column F is the return array. If the ID is not found, XLOOKUP returns #N/A unless you supply the fourth argument, for example =XLOOKUP("E1042", A2:A100, F2:F100, "Not found").
Two rules matter more than any other:
- The lookup array and the return array must be the same size and shape. If one is 99 rows and the other is 100, Excel returns
#VALUE!. - The return array must be a single row or a single column unless you are deliberately returning multiple columns. Returning a block of several columns to a single cell produces a spill error or an unexpected result.
How to Choose the Right Return Array
Choosing the return array is mostly about deciding which piece of information answers the question. A few practical guidelines:
- Identify the unique key first — the column that identifies the record, such as an ID, SKU or email address. That becomes the lookup array.
- Decide what single value you need back. That column becomes the return array.
- Use whole-column references only when the sheet is small; otherwise use exact ranges to keep the formula fast.
- If you need several fields back, either write one XLOOKUP per field or nest the return arrays with CHOOSE or HSTACK so the results spill across adjacent cells.
- Lock the ranges with absolute references (
$A$2:$A$100) before copying the formula down, or the ranges will shift.
A common misconception is that the return array has to be the last column of a table. It does not. It can be any range of the same height as the lookup array, including one on a different worksheet such as Prices!D2:D100.
Common Problems and How to Fix Them
Most XLOOKUP errors trace back to the return array rather than the lookup itself. The usual suspects:
- #VALUE! — the lookup array and return array are different sizes. Check the row counts.
- #N/A — no match was found, or the lookup value has trailing spaces or a different data type (text "123" versus number 123).
- #SPILL! — the return array covers multiple cells but something is blocking the cells where the result needs to appear. Clear the neighbouring cells.
- Wrong but plausible answers — the lookup array contains duplicates. XLOOKUP returns the first match by default; set the search mode to search last-to-first if you need the latest entry.
- Shifting results after copying — relative references moved. Convert them to absolute references.
If a formula returns a value from the wrong row, compare the two ranges side by side. A return array that starts one row lower than the lookup array will silently return every answer offset by one row.
Return Array vs. VLOOKUP's Column Index
The clearest way to understand the return array is to compare it with what it replaced. VLOOKUP takes a table array and a column index number, so the returned column is defined by counting from the left edge of the table. Insert a column in the middle and every VLOOKUP breaks. XLOOKUP's return array is a direct reference, so inserting or moving columns does not change which data comes back. XLOOKUP also defaults to an exact match, whereas VLOOKUP defaults to an approximate match — a frequent source of quietly wrong numbers.
INDEX and MATCH can achieve the same result and remain useful in older versions of Excel that do not have XLOOKUP. In that combination, the MATCH portion plays the role of the lookup array and the INDEX range plays the role of the return array.
Frequently Asked Questions
Is "return array" a real Excel term?
Yes. It is the standard name Microsoft uses for the third argument of XLOOKUP, and it appears in the function's argument prompt and official documentation. It is not slang.
Can the return array be on another sheet?
Yes. Reference it with the sheet name, for example Sheet2!D2:D100. The range must still match the height of the lookup array.
Can XLOOKUP return more than one column?
Yes, if you build a multi-column return array, for example with CHOOSE or HSTACK, and there is room for the results to spill into adjacent cells. A single return range returns a single column.
Why does my XLOOKUP return #VALUE!?
Almost always because the lookup array and return array are different sizes. Count the rows in both ranges and make them match.
Does the return array have to be to the right of the lookup array?
No. Unlike VLOOKUP, XLOOKUP can return values from columns to the left of the lookup column, because the return array is referenced directly rather than by position.