I have this range...A1:D5
I want to look up the rows where b = "salary" and place them in a new table. That part is pretty easy, and can be done many ways using query, filter, index/match, vlookup, and/or {arrays}.
The part I'm having trouble with, is that I want the initial result to be repeated a variable number of times. For example, if I wanted to search for all rows where B = "salary", and I wanted to repeat that result 3 times in the new table, i would want it to look like this....
I have tried this using all the above mentioned functions and techniques, and I can only ever get the first row to appear when using them in conjunction with ArrayFormula.
Some of the methods I've tried are as follows
=ARRAYFORMULA(INDEX ('Employees'!A2:D5, MATCH("salary", 'Employees'!B2:B, 0)))
=ARRAYFORMULA(VLOOKUP("salary",Employees!B2:D, {1,2,3}, FALSE))
=ARRAYFORMULA(QUERY('Employees'!A2:D, "Select * where B = 'salary'", 0))
=ARRAYFORMULA(TRANSPOSE(QUERY(TRANSPOSE(QUERY(Employees!$A$2:$D, "SELECT * WHERE B = 'salary'", 0 )),"SELECT Col"&((row(J9:J30)-1)-(ROUNDDOWN((row(J9:J30)-1)/3,0)*3))+1&"",0)))


