SOLVED

Multi Column Return Array in Xlookup

Brass Contributor

@Sergei Baklan @Peter Bartholomew @lori_m @Chris_Gross

 

When the Lookup value is a single cell, the Return_Array is returning two columns as desired in the following formula

=XLOOKUP(C2,TAN!$B$1:$B$188,TAN!$D$1:$E$188,,0,1)

KanwalNo1_1-1637548373843.png


But when the Lookup_Value is a Range, the Return_Array is returning only the 1st Column.

=XLOOKUP(C2:C7,TAN!$B$1:$B$188,TAN!$D$1:$E$188,,0,1)

KanwalNo1_0-1637548328882.png

Is it a Bug or I am missing something !

 

3 Replies
best response confirmed by KanwalNo1 (Brass Contributor)
Solution

@KanwalNo1 

IMHO, that is correct behaviour. In second case you try to return array of array which is not supported.

Ahh ! That is the Case ! I am amazed at how easily we can assume the things, which are yet to come into foray. May be Microsoft has given wings to our thoughts ! Thanks Sergei ! You have my admiration !

How do you learn and go about the things ? Will you share the secret recipe !

@KanwalNo1 

If you are trying to return a two dimensional array of values, you can use INDEX/XMATCH/XMATCH or, if you have no need to look up the column indices, a hard-wired array {1,2} will return the first two columns.

 

It is a nuisance that, though arrays of arrays, are normal as input (essentially that is what Tables are) it is such hard work to get a 2D array returned.

1 best response

Accepted Solutions
best response confirmed by KanwalNo1 (Brass Contributor)
Solution

@KanwalNo1 

IMHO, that is correct behaviour. In second case you try to return array of array which is not supported.

View solution in original post