I wanted to make a filter function, but the array for criteria is referring to a different cell

Here is an example
My array is C3:C17, I wanted to filter the names on this array based on the list from A3:A5 Here I tried using this formula
=FILTER(HSTACK($C$3:$D$17),C3:C17=A3:A17)
I am expecting to return Agent 1, 5 and 10 with their corresponding Leaders on cell F3 but instead the formula only return 1 result which is Agent 1 and Leader 1
Expecting/Desired result

Using ISNUMBER and XMATCH:
=FILTER(C3:D17,ISNUMBER(XMATCH(C3:C17,A3:A5)))

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With