Grumpy88
Member
Hi.
Shrivallabha was kind enough to help me in my previous post "Need a COUNT formula with multiple AND and OR criteria" with solving my issue to develop a formula that counts the number of records in a table that simultaneously complies with multiple compulsory and optional criteria.
To recap the situation briefly, I needed a formula to count the number of records in which the Product ="Endowment" AND the Branch ="Cape Town", but also in which the Marketer ="Smith" OR ="Jones". I had the Marketers in two different cells (D2 and E2), using dropdown data validation lists to select and display their names.
Shrivallabha then came up with the following formula, which worked perfectly:
=SUMPRODUCT(--($A$2:$A$11="Endowment"),--($B$2:$B$11="Cape Town"),(($C$2:$C$11=D2)+($C$2:$C$11=E2)))
However, is there a formula-based way to tweak my current arrangement so that if I want to see the data for all Marketers, rather than for one or two specifically selected from the dropdown lists in D2 and E2, I can do so (in D2 for instance) by just not selecting anyone (or by pressing Delete to clear the previous selection)?
At the moment as soon as I clear D2 (and E2), the formula resets the results to zero because the source cell is then empty. Ideally an "All" selection on the dropdown list would be best, but because the list content comes from data validation of the entries within the source table, there is no "All" item in the table's Marketers column.
Thanks.
Shrivallabha was kind enough to help me in my previous post "Need a COUNT formula with multiple AND and OR criteria" with solving my issue to develop a formula that counts the number of records in a table that simultaneously complies with multiple compulsory and optional criteria.
To recap the situation briefly, I needed a formula to count the number of records in which the Product ="Endowment" AND the Branch ="Cape Town", but also in which the Marketer ="Smith" OR ="Jones". I had the Marketers in two different cells (D2 and E2), using dropdown data validation lists to select and display their names.
Shrivallabha then came up with the following formula, which worked perfectly:
=SUMPRODUCT(--($A$2:$A$11="Endowment"),--($B$2:$B$11="Cape Town"),(($C$2:$C$11=D2)+($C$2:$C$11=E2)))
However, is there a formula-based way to tweak my current arrangement so that if I want to see the data for all Marketers, rather than for one or two specifically selected from the dropdown lists in D2 and E2, I can do so (in D2 for instance) by just not selecting anyone (or by pressing Delete to clear the previous selection)?
At the moment as soon as I clear D2 (and E2), the formula resets the results to zero because the source cell is then empty. Ideally an "All" selection on the dropdown list would be best, but because the list content comes from data validation of the entries within the source table, there is no "All" item in the table's Marketers column.
Thanks.