简体   繁体   中英

Excel Filter Formula based on another cell get any if empty

So I'm trying to get this sorted out for a while but can't seem to figure it out.

I am using the FILTER formula in order to filter a set of records in a table based on the value of a cell (actually multiple conditions, but nos really the point). The thing is, I would like the formula to filter the records if the condition cell has some text, but if it is empty, I would like it to return ALL records as if there was no filter, and I can't get it right...

This is the formula I am using:

=FILTER(Table;SI(D2<>"";Table[Streaming]=D2;Table[Streaming]=""))

Any clues?

Thanks

Nesting formulas is powerful, when the syntax of the formula is well understood. In the screenshot, this formula filters the table:

=FILTER(Table1,(IF(H2="",TRUE,Table1[Color]=H2))*(IF(H3="",TRUE,Table1[size]=H3))*(IF(H4="",TRUE,Table1[length]=H4)))

在此处输入图像描述

在此处输入图像描述

In case you want to duplicate the whole table if there are no filters specified, then wrap the above formula into an IfErrror() like this:

=IFERROR(FILTER(Table1,IF(H2="",TRUE,Table1[Color]=H2)*IF(H3="",TRUE,Table1[size]=H3)*IF(H4="",TRUE,Table1[length]=H4)*(COUNTA(H2:H4)>1)),Table1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM