Shawn White
Shawn White

Reputation: 41

Filter function and ignoring a condition

I used the following formula to filter a date range between the date entered in A3 and date entered in B3 and also the data entered in C3 that matches column D

=Filter('Sort Violations'!P2:P,'Sort Violations'!C2:C>=Int(A3),'Sort Violations'!C2:C<=Int(B3),'Sort Violations'!D2:D=C3)

I'd like the formula to work where if C3 is empty/blank, the filter still pulls all data from the other conditions in the filter (date range). I think it needs a len in the formula but I'm not sure how...

Upvotes: 0

Views: 161

Answers (1)

player0
player0

Reputation: 1

try this if it works for you:

=IF(LEN(C3), FILTER('Sort Violations'!P2:P, 'Sort Violations'!C2:C>=INT(A3), 
                                            'Sort Violations'!C2:C<=INT(B3),
                                            'Sort Violations'!D2:D=C3), )

Upvotes: 1

Related Questions