SOLVED

Is XLOOKUP Able to Spill In Two Dimensions at Once?

%3CLINGO-SUB%20id%3D%22lingo-sub-3056481%22%20slang%3D%22en-US%22%3EIs%20XLOOKUP%20Able%20to%20Spill%20In%20Two%20Dimensions%20at%20Once%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056481%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20trying%20earlier%20to%20get%20an%20XLOOKUP%20to%20spill%20two%20ways%20at%20once%20off%20of%20a%20dynamic%20range%2C%20I%20could%20spill%20out%20right%20or%20down%2C%20but%20was%20unable%20to%20get%20it%20to%20spill%20both%20ways.%20I%20ended%20up%20just%20filtering%20the%20entire%20array%20(way%20simpler%20to%20begin%20with)%2C%20but%20am%20still%20curious%20if%20this%20is%20possible%20or%20a%20limitation%20of%20XLOOKUP.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3EQuick%20example%3A%3C%2FU%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DKoontz_0-1641848621868.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338470i8A083AC0CC234760%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22DKoontz_0-1641848621868.png%22%20alt%3D%22DKoontz_0-1641848621868.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EShowing%20the%20dynamic%20array%20in%20column%20F%3AF%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DKoontz_1-1641848635589.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338471i5A4F69A0C013EC31%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22DKoontz_1-1641848635589.png%22%20alt%3D%22DKoontz_1-1641848635589.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EXLOOKUP%20on%20each%20individual%20part%20works%20correctly%2C%20returning%20Size%3AShape%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DKoontz_2-1641848645525.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F338472iDD30850140A9DFA2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22DKoontz_2-1641848645525.png%22%20alt%3D%22DKoontz_2-1641848645525.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBut%2C%20XLOOKUP%20on%20the%20dynamic%20array%20in%20F10%23%2C%20only%20spills%20down%2C%20returning%20Size%20and%20doesn't%20spill%20right%20at%20all.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20had%20experience%20with%20this%3F%20I%20may%20also%20be%20missing%20a%20key%20piece%20here.%20Thanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3056481%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Frequent Contributor

I was trying earlier to get an XLOOKUP to spill two ways at once off of a dynamic range, I could spill out right or down, but was unable to get it to spill both ways. I ended up just filtering the entire array (way simpler to begin with), but am still curious if this is possible or a limitation of XLOOKUP.

 

Quick example:

DKoontz_0-1641848621868.png

Showing the dynamic array in column F:F

 

DKoontz_1-1641848635589.png

XLOOKUP on each individual part works correctly, returning Size:Shape

 

DKoontz_2-1641848645525.png

But, XLOOKUP on the dynamic array in F10#, only spills down, returning Size and doesn't spill right at all. 

 

Has anyone had experience with this? I may also be missing a key piece here. Thanks!

 

 

4 Replies

@DKoontz 

You try to return array of arrays which is not supported. That's with lambda and helper function.

 

Here is related sample Array of arrays using Lambda helper functions - Microsoft Tech Community

best response confirmed by DKoontz (Frequent Contributor)
Solution

@DKoontz 

The good news is that XMATCH/INDEX will work and returns an array,

= INDEX(
    Data[[Size]:[Shape]], 
    XMATCH(filtered#,Data[Part]),
    {1,2,3}
  )

XLOOKUP can be made to work but you would need to be desperate or extraordinarily masochistic to attempt it!

= LET(
    THUNK, LAMBDA(x, LAMBDA(x)),
    EXTRACT, LAMBDA(thunkArray, LAMBDA(r,c, INDEX(INDEX(thunkArray,r,1)(),c))),
    thunkTable, BYROW(Data[[Size]:[Shape]], THUNK),
    thunkSelected, XLOOKUP(filtered#, Data[Part], thunkTable),
    MAKEARRAY(ROWS(thunkSelected), 3, EXTRACT(thunkSelected))
  )

Currently you would also need an insider beta version of Excel.

 

Ah okay that's what I suspected. Thank you for providing a link to the array of array using lambda!
Great examples! Thank you so much for taking the time to provide both of these solutions, both achieve the same result. The index method is a little less intimidating but it looks like the Lambda solution has way more flexibility, so many functions within it that I've never even heard of. Really cool. Gave me some good homework, thanks.