stallingOne
stallingOne

Reputation: 4006

How to apply a double filter (horizontal + vertical) in a google spreadsheet?

In google spreadsheets I'm looking for a formula like filter() that can filter both vertically and horizontally.

e.g. I can filter vertically

=filter(D4:H8, D3:H3=5)

or horizontally

=filter(D4:H8,C4:C8=2)

But I wonder if it's possible to do both at the same time.

I tried to put one into the other, but the problem is the second argument of the first filter, the dimension is unknown + I don't know how to reference column or row names.

I also tried the third argument of the filter() function but I get an error

=filter(D4:H8, D3:H3=5,C4:C8=2)

Error FILTER has mismatched range sizes. Expected row count: 1. column count: 5. Actual row count: 1, column count: 1.

Here is concrete example (with edit permissions) : https://docs.google.com/spreadsheets/d/1SYJuv2PQh72L-dfoH0xtugehe0EKp7ZNWHg_xbbqOBA/edit?usp=sharing

Upvotes: 3

Views: 4172

Answers (1)

TheMaster
TheMaster

Reputation: 50855

Double Filter:

=filter(filter(D4:H8, D3:H3=5),C4:C8=2)

Upvotes: 3

Related Questions