Google-sheets – Filter and match multiple columns in Google Sheets

formulasgoogle sheets

I have a list of teams and their corresponding owners in Google Sheets.
(owners own multiple teams)

I have a great formula that will filter the list by owner name:
=FILTER(A2:A6, MATCH(B2:B6,"RINGO",0))

I like using filter in case I had stat columns for the team that I wanted to propagate as well.

My problem is that I actually have TWO sets of data, and they are not on the same column.

  A         B          C          D
GIANTS    RINGO     ROCKETS     GEORGE
DODGERS   GEORGE    BLUE JAYS   PAUL
PACKERS   PAUL      DUCKS       RINGO
KINGS     PAUL      YANKEES     JOHN
BLAZERS   JOHN      LAKERS      JOHN
OILERS    RINGO     BRUINS      GEORGE

I tried using brackets {_,_} to expand my ranges:
=FILTER({A2:A6,C2:C6}, MATCH({B2:B6,D2:D6},"RINGO",0))
But I get the error "FILTER range must be a single row or single column."

I've been searching for a while now and can't seem to come up with a formula that will give me one list for Ringo: GIANTS OILERS DUCKS

Ideas?

Best Answer

You have to "stack" your columns.

You can do that using the following formula:

=FILTER({A4:A10;C4:C10}, MATCH({B4:B10;D4:D10},"RINGO"))

EDIT (following your comment):

=SORT(FILTER({A4:A10;C4:C10}, MATCH({B4:B10;D4:D10},"RINGO")))