Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 495
stallingOne Avatar asked Nov 29 '25 19:11

stallingOne


1 Answers

Double Filter:

=filter(filter(D4:H8, D3:H3=5),C4:C8=2)
like image 197
TheMaster Avatar answered Dec 02 '25 04:12

TheMaster



Donate For Us

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