Search code examples
excelvbafunctionformula

Is it possible to filter horizontally?


Formula =LET(_x,XLOOKUP(G18,B1:P1,B2:P16),FILTER(HSTACK(A2:A16,_x),_x<>0)) works well with vertical filtering, is it possible to filter horizontally as highlighted in green color in the snapshot?

![enter image description here Need like this: enter image description here


Solution

  • You may try INDEX() with MATCH() or XMATCH() function.

    =INDEX($B$2:$I$14,XMATCH($A18,$A$2:$A$14),XMATCH($C$17,$B$1:$I$1))
    

    enter image description here