Forum Discussion
Unperterbed
Feb 10, 2020Copper Contributor
Structured Table References: Multiple non-contiguous columns?
I'm using XLOOKUP (which is AWESOME, btw) to return multiple columns from a table. (See file for example). What I'd like to do is return Sales Amount and Commission Amount, which are non...
Unperterbed
Feb 10, 2020Copper Contributor
Riny_van_Eekelen I think you're right, but that's what I'd like to avoid! I *love* that XLOOKUP can return multiple columns, and that structured references makes it so easy (e.g., Table1[ [Sales]:[Commission] ]), but it seems like an unnecessary constraint that the columns must always be adjacent to each other.
SergeiBaklan
Feb 11, 2020Diamond Contributor
If you use titles for the result, that could be
=INDEX(XLOOKUP($B15,Table1[Sales Person],Table1),,XMATCH($C14:$D14,Table1[#Headers],0))
Just be sure titles here are exactly the same as table headers (I corrected by copy/paste)