luis filipe
luis filipe

Reputation: 35

Filter results to columns with data and 2 or more conditions

I have a database (L1:AC),

The title is from M1:AC with 3 categories (tv shows, music, movies)

I want to apply filters in a way it only appears columns where I have data. Columns where I have no data should not appear in filter results.

I have formulas in BD!B3 for titles and BD!B4 for results.

2 problems with my current formulas, in BD!B4 i only get one row of results and I want to get all corresponding. I would also like to have chance of applying a second condition to the filter.

I have a second sheet "desired results" where I exemplify the results I want to obtain.

Can someone help?

Many thanks for the help.

Sheet here (feel free to edit)

https://docs.google.com/spreadsheets/d/1MOKCaIVDWM18QvPBUUXoUXYXMeS3rPJaJFaig5-72vE/edit?usp=sharing

Upvotes: 0

Views: 39

Answers (1)

player0
player0

Reputation: 1

use:

=QUERY(FILTER(M$2:AD; REGEXMATCH(""&COLUMN(M:AD); 
 JOIN("|"; ""&MATCH(B2; A$1:AD$1; 0)+{1\2\3\4\5\6}))); "where 1=1 "&
 IF(D2=""; "and Col1 is not null";" and Col1 = '"&D2&"'"); 1)

enter image description here

Upvotes: 1

Related Questions