Demonstration of what the result should look like:
I need a formula in Google Sheets that iterates each input from input range, the look-up results for every single input will be stacked into a column per the order that the inputs appear in the range (top to down).
I tried many ways, the best I came up with is
=FLATTEN(ARRAYFORMULA(QUERY(A3:B10, "select B where A = '" & TEXTJOIN("' or A = '", TRUE, D3:D) & "'", 0)))
It cannot handle the repeated inputs and the order they appear in the input range