Forum Discussion
Extract Data Based on a Drop Down List - Deselect Option
- Nov 15, 2023
exceljunior Another option is to use the IF function with ISBLANK to perform a different calculation if the criteria cells are blank. For example:
=FILTER(Sales, IF(ISBLANK(H4), ROW(Sales), Sales[Branch]=H4)*IF(ISBLANK(H6), ROW(Sales), Sales[Products]=H6), "Nothing Found")
The ROW function in the above formula simply returns the row number for each row in the table, if the criteria cell is blank. The FILTER function interprets all numeric values as TRUE (other than 0, which is interpreted as FALSE), so all records will be returned if both criteria cells are blank.
exceljunior Another option is to use the IF function with ISBLANK to perform a different calculation if the criteria cells are blank. For example:
=FILTER(Sales, IF(ISBLANK(H4), ROW(Sales), Sales[Branch]=H4)*IF(ISBLANK(H6), ROW(Sales), Sales[Products]=H6), "Nothing Found")
The ROW function in the above formula simply returns the row number for each row in the table, if the criteria cell is blank. The FILTER function interprets all numeric values as TRUE (other than 0, which is interpreted as FALSE), so all records will be returned if both criteria cells are blank.
- exceljuniorNov 16, 2023Copper ContributorThanks DJ!