Forum Discussion
Excel 365 - Count visible rows with multiple criteria
- May 29, 2020
Here we need to implement OR condition to calculate both options. For such sample
we may use
=SUMPRODUCT( ( (G8:G5000="WIDGETS")+(G8:G5000="WIDGETS - WITH CHEESE"))*(SUBTOTAL(103,OFFSET(G8,ROW(G8:G5000)-MIN(ROW(G8:G5000)),0))))
filtered result will be
Another variant could be with helper column C, where we add the formula
=AGGREGATE(3,5,F8)
which returns zero for hided rows and 1 for visible. Formula to sum will be
=SUMPRODUCT(( (G8:G5000="WIDGETS")+(G8:G5000="WIDGETS - WITH CHEESE"))*H8:H5000)
Above is regular one (non-array)
Here we need to implement OR condition to calculate both options. For such sample
we may use
=SUMPRODUCT( ( (G8:G5000="WIDGETS")+(G8:G5000="WIDGETS - WITH CHEESE"))*(SUBTOTAL(103,OFFSET(G8,ROW(G8:G5000)-MIN(ROW(G8:G5000)),0))))
filtered result will be
Another variant could be with helper column C, where we add the formula
=AGGREGATE(3,5,F8)
which returns zero for hided rows and 1 for visible. Formula to sum will be
=SUMPRODUCT(( (G8:G5000="WIDGETS")+(G8:G5000="WIDGETS - WITH CHEESE"))*H8:H5000)
Above is regular one (non-array)
SergeiBaklan, this is fantastic! I tried and tried to figure out the OR option and after exhausting my brain figured there was someone smarter that might be willing to help, and here you did! Thank you, I'm most appreciative.